From: Timo Röhling Date: Sun, 24 Oct 2021 08:40:57 +0000 (+0200) Subject: Initial release X-Git-Tag: archive/raspbian/1.9.25+dfsg3-1+rpi1^2~86 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=470e604a9af259a9bbfcd9375ef9f1f6b320a4f1;p=filament.git Initial release --- diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..363cdd3 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +filament (1.9.25+dfsg-1) unstable; urgency=medium + + * Initial release (Closes: #974734) + + -- Timo Röhling Sun, 24 Oct 2021 10:33:22 +0200 diff --git a/debian/cmake/benchmark.cmake b/debian/cmake/benchmark.cmake new file mode 100644 index 0000000..0c0f551 --- /dev/null +++ b/debian/cmake/benchmark.cmake @@ -0,0 +1,5 @@ +find_package(benchmark REQUIRED) +add_library(benchmark INTERFACE) +target_link_libraries(benchmark INTERFACE benchmark::benchmark) +add_library(benchmark_main INTERFACE) +target_link_libraries(benchmark_main INTERFACE benchmark::benchmark_main) diff --git a/debian/cmake/glslang.cmake b/debian/cmake/glslang.cmake new file mode 100644 index 0000000..eeb6d9a --- /dev/null +++ b/debian/cmake/glslang.cmake @@ -0,0 +1,12 @@ +# Empty +find_package(PkgConfig REQUIRED) +pkg_check_modules(glslang REQUIRED IMPORTED_TARGET spirv glslang) +add_library(glslang INTERFACE) +target_include_directories(glslang INTERFACE + /usr/include/glslang/Public + /usr/include/glslang/Include + /usr/include/glslang/MachineIndependent + /usr/include/glslang/SPIRV + ) +set_property(TARGET PkgConfig::glslang APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${STDCXX_LIBRARY}) +target_link_libraries(glslang INTERFACE PkgConfig::glslang) diff --git a/debian/cmake/imgui.cmake b/debian/cmake/imgui.cmake new file mode 100644 index 0000000..1c3c96a --- /dev/null +++ b/debian/cmake/imgui.cmake @@ -0,0 +1,9 @@ +find_path(imgui_INCLUDE_DIR NAMES imgui.h PATH_SUFFIXES imgui) +find_library(imgui_LIBRARY NAMES imgui) +if(imgui_INCLUDE_DIR AND imgui_LIBRARY) + add_library(filament::imgui INTERFACE IMPORTED) + set_target_properties(filament::imgui PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${imgui_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${imgui_LIBRARY}" + ) +endif() diff --git a/debian/cmake/jsmn.cmake b/debian/cmake/jsmn.cmake new file mode 100644 index 0000000..c965e75 --- /dev/null +++ b/debian/cmake/jsmn.cmake @@ -0,0 +1,3 @@ +find_path(jsmn_INCLUDE_DIR NAMES jsmn.h) +add_library(jsmn INTERFACE) +target_include_directories(jsmn INTERFACE ${jsmn_INCLUDE_DIR}) diff --git a/debian/cmake/libassimp.cmake b/debian/cmake/libassimp.cmake new file mode 100644 index 0000000..9e5e166 --- /dev/null +++ b/debian/cmake/libassimp.cmake @@ -0,0 +1,6 @@ +# find_package(assimp) and target assimp::assimp is broken, so we do this manually +find_path(assimp_INCLUDE_DIR NAMES assimp/version.h) +find_library(assimp_LIBRARY NAMES assimp) +add_library(assimp INTERFACE) +target_include_directories(assimp INTERFACE ${assimp_INCLUDE_DIR}) +target_link_libraries(assimp INTERFACE ${assimp_LIBRARY}) diff --git a/debian/cmake/package-config.cmake.in b/debian/cmake/package-config.cmake.in new file mode 100644 index 0000000..1002f29 --- /dev/null +++ b/debian/cmake/package-config.cmake.in @@ -0,0 +1,15 @@ +@PACKAGE_INIT@ +include(CMakeFindDependencyMacro) +find_dependency(Threads) +find_dependency(tsl-robin-map) +foreach(dep IN ITEMS imgui stb) + include(${CMAKE_CURRENT_LIST_DIR}/${dep}.cmake) + if(NOT TARGET filament::${dep}) + set(filament_FOUND FALSE) + set(filament_NOT_FOUND_MESSAGE "filament could not be found because dependency ${dep} could not be found.") + return() + endif() +endforeach() +include(${CMAKE_CURRENT_LIST_DIR}/filamentTargets.cmake) +message(STATUS "Found filament: ${PACKAGE_PREFIX_DIR} (found version \"@FILAMENT_VERSION@\")") + diff --git a/debian/cmake/spirv-cross.cmake b/debian/cmake/spirv-cross.cmake new file mode 100644 index 0000000..117bb7f --- /dev/null +++ b/debian/cmake/spirv-cross.cmake @@ -0,0 +1,5 @@ +find_package(spirv_cross_c_shared REQUIRED) +find_package(spirv_cross_cpp REQUIRED) +add_library(spirv-cross INTERFACE) +target_link_libraries(spirv-cross INTERFACE spirv-cross-cpp spirv-cross-c-shared) + diff --git a/debian/cmake/spirv-tools.cmake b/debian/cmake/spirv-tools.cmake new file mode 100644 index 0000000..8b9f6af --- /dev/null +++ b/debian/cmake/spirv-tools.cmake @@ -0,0 +1,4 @@ +find_package(PkgConfig REQUIRED) +pkg_check_modules(SPIRV-Tools REQUIRED IMPORTED_TARGET SPIRV-Tools) +add_library(SPIRV-Tools-opt INTERFACE) +target_link_libraries(SPIRV-Tools-opt INTERFACE PkgConfig::SPIRV-Tools) diff --git a/debian/cmake/stb.cmake b/debian/cmake/stb.cmake new file mode 100644 index 0000000..648673c --- /dev/null +++ b/debian/cmake/stb.cmake @@ -0,0 +1,9 @@ +find_path(stb_INCLUDE_DIR NAMES stb.h PATH_SUFFIXES stb) +find_library(stb_LIBRARY NAMES stb) +if(stb_INCLUDE_DIR AND stb_LIBRARY) + add_library(filament::stb INTERFACE IMPORTED) + set_target_properties(filament::stb PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${stb_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${stb_LIBRARY}" + ) +endif() diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..82c4e20 --- /dev/null +++ b/debian/control @@ -0,0 +1,69 @@ +Source: filament +Section: libs +Priority: optional +Maintainer: Timo Röhling +Build-Depends: debhelper-compat (= 13), + clang-11, + cmake, + glslang-dev, + libassimp-dev, + libastcenc-dev, + libbenchmark-dev, + libdraco-dev, + libgl-dev, + libgtest-dev, + libimgui-dev, + libjsmn-dev, + libmeshoptimizer-dev, + libpng-dev, + libsdl2-dev, + libstb-dev, + libtinyexr-dev, + robin-map-dev, + spirv-tools, + zlib1g-dev, +Homepage: https://github.com/google/filament +Standards-Version: 4.6.0 +Rules-Requires-Root: no +Vcs-Git: https://salsa.debian.org/roehling/filament.git +Vcs-Browser: https://salsa.debian.org/roehling/filament + +Package: libfilament1.9 +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + ${shlibs:Depends}, +Description: Real-time physically based rendering engine + Physically based rendering is a rendering method that provides a more + accurate representation of materials and how they interact with light + when compared to traditional real-time models. + +Package: libfilament-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + libfilament1.9 (= ${binary:Version}), + libimgui-dev, + libstb-dev, + robin-map-dev, +Recommends: libfilament-tools (= ${binary:Version}) +Description: Real-time physically based rendering engine - development headers + Physically based rendering is a rendering method that provides a more + accurate representation of materials and how they interact with light + when compared to traditional real-time models. + . + This package installs the development headers. + +Package: libfilament-tools +Section: devel +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, + ${shlibs:Depends}, +Description: Real-time physically based rendering engine - command-line tools + Physically based rendering is a rendering method that provides a more + accurate representation of materials and how they interact with light + when compared to traditional real-time models. + . + This package installs the command-line tools for material preprocessing. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..9f8ea17 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,204 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/google/filament +Files-Excluded: + android + assets + docs + ide + ios + java + third_party/astcenc + third_party/benchmark + third_party/clang + third_party/civetweb/docs + third_party/civetweb/examples + third_party/civetweb/resources + third_party/civetweb/unittest + third_party/draco + third_party/environments + third_party/gl-matrix + third_party/glslang + third_party/imgui + third_party/jsmn + third_party/libassimp + third_party/libgtest + third_party/libpng + third_party/libsdl2 + third_party/libz + third_party/markdeep + third_party/meshoptimizer + third_party/models + third_party/moltenvk + third_party/robin-map + third_party/spirv-tools + third_party/stb + third_party/textures + third_party/tinyexr +Comment: removed superfluous copies of debianized third-party libraries; + moltenvk is MacOS only and prebuilt; + ide and iOS files are useless for Debian; + documentation is prebuilt and pretty big; + the vendored astcenc version is very old and not free software; + the example assets are huge and not needed; + +Files: * +Copyright: 2012-2021, The Android Open Source Project + 2015-2021, Google LLC + 2017, Romain Guy +License: Apache-2.0 + +Files: debian/* +Copyright: 2021, Timo Röhling +License: Apache-2.0 + +Files: third_party/civetweb/* +Copyright: 2013-2018, CivetWeb Developers + 2004-2013, Sergey Lyubka + 2013, No Face Press LLC + 2014, Jordan Shelley + 2007-2013, Gerald Franz + 1995-2017, Jean-Loup Gailly and Mark Adler + 1994-2015, Lua.org + 2002-2016, Tiago Dianizio and Doug Currie +License: Expat + +Files: third_party/cgltf/* +Copyright: 2018, Johannes Kuhlmann +License: Expat + +Files: third_party/etc2comp/* +Copyright: 2015, Etc2Comp Authors +License: Apache-2.0 + +Files: third_party/getopt/* +Copyright: The Regents of the University of California +License: BSD-3-clause + +Files: third_party/hat-trie/* +Copyright: 2017, Thibaut Goetghebuer-Planchon +License: Expat + +Files: third_party/smol-v/* +Copyright: 2016-2018, Aras Pranckevicius +License: Expat or public-domain + +Files: third_party/spirv-cross/* +Copyright: 2015-2021, ARM Limited + 2018-2021, Bradley Austin Davis + 2016-2021, Google Inc + 2019-2021, Hans-Kristian Arntzen + 2016-2021, Robert Konrad + 2016-2021, The Brenwill Workshop Ltd +License: Apache-2.0 + +Files: third_party/spirv-cross/GLSL.std.450.h + third_party/spirv-cross/spirv.h + third_party/spirv-cross/spirv.hpp +Copyright: 2014-2020, The Khronos Group Inc +License: MIT/X11/Khronos + +Files: third_party/vkmemalloc/* +Copyright: 2017-2021, Advanced Micro Devices, Inc +License: Expat + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, you can find the full license text in + /usr/share/common-licenses/Apache-2.0 + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS + IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: MIT/X11/Khronos + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and/or associated documentation files (the "Materials"), + to deal in the Materials without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Materials, and to permit persons to whom the + Materials are furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Materials. + . + MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS + STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND + HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ + . + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS + IN THE MATERIALS. + +License: public-domain + This is free and unencumbered software released into the public domain. + Anyone is free to copy, modify, publish, use, compile, sell, or distribute this + software, either in source code form or as a compiled binary, for any purpose, + commercial or non-commercial, and by any means. + In jurisdictions that recognize copyright laws, the author or authors of this + software dedicate any and all copyright interest in the software to the public + domain. We make this dedication for the benefit of the public at large and to + the detriment of our heirs and successors. We intend this dedication to be an + overt act of relinquishment in perpetuity of all present and future rights to + this software under copyright law. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/libfilament-dev.docs b/debian/libfilament-dev.docs new file mode 100644 index 0000000..72f7519 --- /dev/null +++ b/debian/libfilament-dev.docs @@ -0,0 +1,2 @@ +usr/README.md +usr/docs/*.md diff --git a/debian/libfilament-dev.install b/debian/libfilament-dev.install new file mode 100644 index 0000000..42012e1 --- /dev/null +++ b/debian/libfilament-dev.install @@ -0,0 +1,4 @@ +usr/include/filament-* +usr/lib/*/libfilament*.so +usr/lib/*/libfilament*.a +usr/lib/*/cmake/filament-* diff --git a/debian/libfilament-tools.install b/debian/libfilament-tools.install new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/libfilament-tools.install @@ -0,0 +1 @@ +usr/bin diff --git a/debian/libfilament-tools.manpages b/debian/libfilament-tools.manpages new file mode 100644 index 0000000..281d4ba --- /dev/null +++ b/debian/libfilament-tools.manpages @@ -0,0 +1,10 @@ +debian/manpages/cmgen.1 +debian/manpages/filamesh.1 +debian/manpages/glslminifier.1 +debian/manpages/matc.1 +debian/manpages/matinfo.1 +debian/manpages/mipgen.1 +debian/manpages/normal-blending.1 +debian/manpages/resgen.1 +debian/manpages/roughness-prefilter.1 +debian/manpages/specular-color.1 diff --git a/debian/libfilament1.9.install b/debian/libfilament1.9.install new file mode 100644 index 0000000..b643a98 --- /dev/null +++ b/debian/libfilament1.9.install @@ -0,0 +1 @@ +usr/lib/*/libfilament*.so.* diff --git a/debian/manpages/cmgen.1 b/debian/manpages/cmgen.1 new file mode 100644 index 0000000..318adc1 --- /dev/null +++ b/debian/manpages/cmgen.1 @@ -0,0 +1,288 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH CMGEN "1" "October 2021" "cmgen is a command-line tool for generating SH and mipmap levels from an env map." "User Commands" +.SH NAME +cmgen \- filament material tools +.SH DESCRIPTION +cmgen is a command\-line tool for generating SH and mipmap levels from an env map. +Cubemaps and equirectangular formats are both supported, automatically detected +according to the aspect ratio of the source image. +.SS "Usages:" +.IP +cmgen [options] +cmgen [options] +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +Quiet mode. Suppress all non\-error output +.HP +\fB\-\-type\fR=\fI\,[cubemap\/\fR|equirect|octahedron|ktx], \fB\-t\fR [cubemap|equirect|octahedron|ktx] +.IP +Specify output type (default: cubemap) +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|rgbm|rgb32f|png|dds|ktx], \fB\-f\fR [exr|hdr|psd|rgbm|rgb32f|png|dds|ktx] +.IP +Specify output file format. ktx implies \fB\-type\fR=\fI\,ktx\/\fR. +KTX files are always encoded with 3\-channel RGB_10_11_11_REV data +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +Format specific compression: +.IP +KTX: +.IP +astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block size +s3tc_rgba_dxt5 +etc_FORMAT_METRIC_EFFORT +.IP +FORMAT is rgb8_alpha, srgb8_alpha, rgba8, or srgb8_alpha8 +METRIC is rgba, rgbx, rec709, numeric, or normalxyz +EFFORT is an integer between 0 and 100 +.IP +PNG: Ignored +PNG RGBM: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.HP +\fB\-\-size\fR=\fI\,power\-of\-two\/\fR, \fB\-s\fR power\-of\-two +.IP +Size of the output cubemaps (base level), 256 by default +Also applies to DFG LUT +.HP +\fB\-\-deploy\fR=\fI\,dir\/\fR, \fB\-x\fR dir +.IP +Generate everything needed for deployment into +.HP +\fB\-\-extract\fR=\fI\,dir\/\fR +.IP +Extract faces of the cubemap into +.HP +\fB\-\-extract\-blur\fR=\fI\,roughness\/\fR +.IP +Blurs the cubemap before saving the faces using the roughness blur +.HP +\fB\-\-clamp\fR +.IP +Clamp environment before processing +.HP +\fB\-\-no\-mirror\fR +.IP +Skip mirroring of generated cubemaps (for assets with mirroring already backed in) +.HP +\fB\-\-ibl\-samples\fR=\fI\,numSamples\/\fR +.IP +Number of samples to use for IBL integrations (default 1024) +.HP +\fB\-\-ibl\-ld\fR=\fI\,dir\/\fR +.IP +Roughness pre\-filter into +.HP +\fB\-\-sh\-shader\fR +.IP +Generate irradiance SH for shader code +.SS "Private use only:" +.HP +\fB\-\-ibl\-dfg\fR=\fI\,filename\/\fR.[exr|hdr|psd|png|rgbm|rgb32f|dds|h|hpp|c|cpp|inc|txt] +.IP +Compute the IBL DFG LUT +.HP +\fB\-\-ibl\-dfg\-multiscatter\fR +.IP +If \fB\-\-ibl\-dfg\fR is set, computes the DFG for multi\-scattering GGX +.HP +\fB\-\-ibl\-dfg\-cloth\fR +.IP +If \fB\-\-ibl\-dfg\fR is set, adds a 3rd channel to the DFG for cloth shading +.HP +\fB\-\-ibl\-is\-mipmap\fR=\fI\,dir\/\fR +.IP +Generate mipmap for pre\-filtered importance sampling +.HP +\fB\-\-ibl\-irradiance\fR=\fI\,dir\/\fR +.IP +Diffuse irradiance into +.HP +\fB\-\-ibl\-no\-prefilter\fR +.IP +Use importance sampling instead of prefiltered importance sampling +.HP +\fB\-\-ibl\-min\-lod\-size\fR +.IP +Minimum LOD size [default: 16] +.HP +\fB\-\-sh\fR=\fI\,bands\/\fR +.IP +SH decomposition of input cubemap +.HP +\fB\-\-sh\-output\fR=\fI\,filename\/\fR.[exr|hdr|psd|rgbm|rgb32f|png|dds|txt] +.IP +SH output format. The filename extension determines the output format +.HP +\fB\-\-sh\-irradiance\fR, \fB\-i\fR +.IP +Irradiance SH coefficients +.HP +\fB\-\-sh\-window\fR=\fI\,cutoff\/\fR|no|auto (default), \fB\-w\fR cutoff|no|auto (default) +.IP +SH windowing to reduce ringing +.HP +\fB\-\-debug\fR, \fB\-d\fR +.IP +Generate extra data for debugging +.PP +Cubemaps and equirectangular formats are both supported, automatically detected +according to the aspect ratio of the source image. +.SS "Usages:" +.IP +cmgen [options] +cmgen [options] +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +Quiet mode. Suppress all non\-error output +.HP +\fB\-\-type\fR=\fI\,[cubemap\/\fR|equirect|octahedron|ktx], \fB\-t\fR [cubemap|equirect|octahedron|ktx] +.IP +Specify output type (default: cubemap) +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|rgbm|rgb32f|png|dds|ktx], \fB\-f\fR [exr|hdr|psd|rgbm|rgb32f|png|dds|ktx] +.IP +Specify output file format. ktx implies \fB\-type\fR=\fI\,ktx\/\fR. +KTX files are always encoded with 3\-channel RGB_10_11_11_REV data +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +Format specific compression: +.IP +KTX: +.IP +astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block size +s3tc_rgba_dxt5 +etc_FORMAT_METRIC_EFFORT +.IP +FORMAT is rgb8_alpha, srgb8_alpha, rgba8, or srgb8_alpha8 +METRIC is rgba, rgbx, rec709, numeric, or normalxyz +EFFORT is an integer between 0 and 100 +.IP +PNG: Ignored +PNG RGBM: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.HP +\fB\-\-size\fR=\fI\,power\-of\-two\/\fR, \fB\-s\fR power\-of\-two +.IP +Size of the output cubemaps (base level), 256 by default +Also applies to DFG LUT +.HP +\fB\-\-deploy\fR=\fI\,dir\/\fR, \fB\-x\fR dir +.IP +Generate everything needed for deployment into +.HP +\fB\-\-extract\fR=\fI\,dir\/\fR +.IP +Extract faces of the cubemap into +.HP +\fB\-\-extract\-blur\fR=\fI\,roughness\/\fR +.IP +Blurs the cubemap before saving the faces using the roughness blur +.HP +\fB\-\-clamp\fR +.IP +Clamp environment before processing +.HP +\fB\-\-no\-mirror\fR +.IP +Skip mirroring of generated cubemaps (for assets with mirroring already backed in) +.HP +\fB\-\-ibl\-samples\fR=\fI\,numSamples\/\fR +.IP +Number of samples to use for IBL integrations (default 1024) +.HP +\fB\-\-ibl\-ld\fR=\fI\,dir\/\fR +.IP +Roughness pre\-filter into +.HP +\fB\-\-sh\-shader\fR +.IP +Generate irradiance SH for shader code +.SS "Private use only:" +.HP +\fB\-\-ibl\-dfg\fR=\fI\,filename\/\fR.[exr|hdr|psd|png|rgbm|rgb32f|dds|h|hpp|c|cpp|inc|txt] +.IP +Compute the IBL DFG LUT +.HP +\fB\-\-ibl\-dfg\-multiscatter\fR +.IP +If \fB\-\-ibl\-dfg\fR is set, computes the DFG for multi\-scattering GGX +.HP +\fB\-\-ibl\-dfg\-cloth\fR +.IP +If \fB\-\-ibl\-dfg\fR is set, adds a 3rd channel to the DFG for cloth shading +.HP +\fB\-\-ibl\-is\-mipmap\fR=\fI\,dir\/\fR +.IP +Generate mipmap for pre\-filtered importance sampling +.HP +\fB\-\-ibl\-irradiance\fR=\fI\,dir\/\fR +.IP +Diffuse irradiance into +.HP +\fB\-\-ibl\-no\-prefilter\fR +.IP +Use importance sampling instead of prefiltered importance sampling +.HP +\fB\-\-ibl\-min\-lod\-size\fR +.IP +Minimum LOD size [default: 16] +.HP +\fB\-\-sh\fR=\fI\,bands\/\fR +.IP +SH decomposition of input cubemap +.HP +\fB\-\-sh\-output\fR=\fI\,filename\/\fR.[exr|hdr|psd|rgbm|rgb32f|png|dds|txt] +.IP +SH output format. The filename extension determines the output format +.HP +\fB\-\-sh\-irradiance\fR, \fB\-i\fR +.IP +Irradiance SH coefficients +.HP +\fB\-\-sh\-window\fR=\fI\,cutoff\/\fR|no|auto (default), \fB\-w\fR cutoff|no|auto (default) +.IP +SH windowing to reduce ringing +.HP +\fB\-\-debug\fR, \fB\-d\fR +.IP +Generate extra data for debugging diff --git a/debian/manpages/filamesh.1 b/debian/manpages/filamesh.1 new file mode 100644 index 0000000..f67cd21 --- /dev/null +++ b/debian/manpages/filamesh.1 @@ -0,0 +1,55 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH FILAMESH "1" "October 2021" "filamesh is a tool to convert meshes into an optimized binary format" "User Commands" +.SH NAME +filamesh \- filament material tools +.SH DESCRIPTION +filamesh is a tool to convert meshes into an optimized binary format +Usage: +.IP +filamesh [options] +.SS "Supported mesh formats:" +.IP +FBX, OBJ +.PP +Input meshes must have texture coordinates. +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-interleaved\fR, \fB\-i\fR +.IP +interleaves mesh attributes +.HP +\fB\-\-compress\fR, \fB\-c\fR +.IP +enable compression +.SS "Usage:" +.IP +filamesh [options] +.SS "Supported mesh formats:" +.IP +FBX, OBJ +.PP +Input meshes must have texture coordinates. +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-interleaved\fR, \fB\-i\fR +.IP +interleaves mesh attributes +.HP +\fB\-\-compress\fR, \fB\-c\fR +.IP +enable compression diff --git a/debian/manpages/glslminifier.1 b/debian/manpages/glslminifier.1 new file mode 100644 index 0000000..de20524 --- /dev/null +++ b/debian/manpages/glslminifier.1 @@ -0,0 +1,77 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH GLSLMINIFIER "1" "October 2021" "glslminifier " "User Commands" +.SH NAME +glslminifier \- filament material tools +.SH DESCRIPTION +glslminifier minifies GLSL shader code by removing comments, blank lines and indentation. +.SS "Usage:" +.IP +glslminifier [options] +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message. +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +Print copyright and license information. +.HP +\fB\-\-output\fR, \fB\-o\fR +.IP +Specify path to output file. If none provided, writes to stdout. +.HP +\fB\-\-optimization\fR, \fB\-O\fR [none] +.IP +Set the level of optimization. "none" performs a simple passthrough. +.HP +\fB\-\-line\fR, \fB\-l\fR [name] +.IP +Insert a #line directive on the first line of the shader with the given name. +For example, \fB\-\-line\fR foobar.h will insert the following: +.IP +#if defined(GL_GOOGLE_cpp_style_line_directive) +#line 0 "foobar.h" +#endif +.IP +This option is meant to be used with \fB\-Onone\fR optimization. +.SS "Example:" +.IP +glslminifier \fB\-o\fR output.fs.min input.fs +> Output file: output.fs.min +.PP +glslminifier minifies GLSL shader code by removing comments, blank lines and indentation. +.SS "Usage:" +.IP +glslminifier [options] +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message. +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +Print copyright and license information. +.HP +\fB\-\-output\fR, \fB\-o\fR +.IP +Specify path to output file. If none provided, writes to stdout. +.HP +\fB\-\-optimization\fR, \fB\-O\fR [none] +.IP +Set the level of optimization. "none" performs a simple passthrough. +.HP +\fB\-\-line\fR, \fB\-l\fR [name] +.IP +Insert a #line directive on the first line of the shader with the given name. +For example, \fB\-\-line\fR foobar.h will insert the following: +.IP +#if defined(GL_GOOGLE_cpp_style_line_directive) +#line 0 "foobar.h" +#endif +.IP +This option is meant to be used with \fB\-Onone\fR optimization. +.SS "Example:" +.IP +glslminifier \fB\-o\fR output.fs.min input.fs +> Output file: output.fs.min diff --git a/debian/manpages/matc.1 b/debian/manpages/matc.1 new file mode 100644 index 0000000..01ee64e --- /dev/null +++ b/debian/manpages/matc.1 @@ -0,0 +1,88 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH MATC "1" "October 2021" "matc 10" "User Commands" +.SH NAME +matc \- filament material tools +.SH DESCRIPTION +matc is a command\-line tool to compile material definition. +Usages: +.IP +matc [options] +.SS "Supported input formats:" +.IP +Filament material definition (.mat) +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-output\fR, \fB\-o\fR +.IP +Specify path to output file +.HP +\fB\-\-platform\fR, \fB\-p\fR +.IP +Shader family to generate: desktop, mobile or all (default) +.HP +\fB\-\-optimize\-size\fR, \fB\-S\fR +.IP +Optimize generated shader code for size instead of just performance +.HP +\fB\-\-api\fR, \fB\-a\fR +.IP +Specify the target API: opengl (default), vulkan, metal, or all +This flag can be repeated to individually select APIs for inclusion: +.IP +matc \fB\-\-api\fR opengl \fB\-\-api\fR metal ... +.HP +\fB\-\-define\fR, \fB\-D\fR +.IP +Add a preprocessor define macro via =. defaults to 1 if omitted. +Can be repeated to specify multiple definitions: +.IP +matc \fB\-Dfoo\fR=\fI\,1\/\fR \fB\-Dbar\fR \fB\-Dbuzz\fR=\fI\,100\/\fR ... +.HP +\fB\-\-reflect\fR, \fB\-r\fR +.IP +Reflect the specified metadata as JSON: parameters +.HP +\fB\-\-variant\-filter=\fR, \fB\-V\fR +.IP +Filter out specified comma\-separated variants: +.IP +directionalLighting, dynamicLighting, shadowReceiver, skinning, vsm, fog +.IP +This variant filter is merged with the filter from the material, if any +.HP +\fB\-\-version\fR, \fB\-v\fR +.IP +Print the material version number +.SS "Internal use and debugging only:" +.HP +\fB\-\-optimize\-none\fR, \fB\-g\fR +.IP +Disable all shader optimizations, for debugging +.HP +\fB\-\-preprocessor\-only\fR, \fB\-E\fR +.IP +Optimize shaders by running only the preprocessor +.HP +\fB\-\-raw\fR, \fB\-w\fR +.IP +Compile a raw GLSL shader into a SPIRV binary chunk +.HP +\fB\-\-output\-format\fR, \fB\-f\fR +.IP +Specify output format: blob (default) or header +.HP +\fB\-\-debug\fR, \fB\-d\fR +.IP +Generate extra data for debugging +.HP +\fB\-\-print\fR, \fB\-t\fR +.IP +Print generated shaders for debugging diff --git a/debian/manpages/matinfo.1 b/debian/manpages/matinfo.1 new file mode 100644 index 0000000..29cfff0 --- /dev/null +++ b/debian/manpages/matinfo.1 @@ -0,0 +1,109 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH MATINFO "1" "October 2021" "matinfo prints information about material files compiled with matc" "User Commands" +.SH NAME +matinfo \- filament material tools +.SH DESCRIPTION +matinfo prints information about material files compiled with matc +Usage: +.IP +matinfo [options] +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-print\-glsl\fR=\fI\,[index]\/\fR, \fB\-g\fR +.IP +Print GLSL for the nth shader (0 is the first OpenGL shader) +.HP +\fB\-\-print\-spirv\fR=\fI\,[index]\/\fR, \fB\-s\fR +.IP +Validate and print disasm for the nth shader (0 is the first Vulkan shader) +.HP +\fB\-\-print\-metal\fR=\fI\,[index]\/\fR, \fB\-m\fR +.IP +Print Metal Shading Language for the nth shader (0 is the first Metal shader) +.HP +\fB\-\-print\-vkglsl\fR=\fI\,[index]\/\fR, \fB\-v\fR +.IP +Print the nth Vulkan shader transpiled into GLSL +.HP +\fB\-\-print\-dic\-glsl\fR +.IP +Print the GLSL dictionary +.HP +\fB\-\-print\-dic\-metal\fR +.IP +Print the Metal dictionary +.HP +\fB\-\-print\-dic\-vk\fR +.IP +Print the Vulkan dictionary +.HP +\fB\-\-web\-server\fR=\fI\,[port]\/\fR, \fB\-w\fR +.IP +Serve a web page at the given port (e.g. 8080) +.HP +\fB\-\-dump\-binary\fR=\fI\,[index]\/\fR, \fB\-b\fR +.IP +Dump binary SPIRV for the nth Vulkan shader to 'out.spv' +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-analyze\-spirv\fR=\fI\,[index]\/\fR, \fB\-a\fR +.IP +Print annotated GLSL for the nth shader (0 is the first Vulkan shader) +.SS "Usage:" +.IP +matinfo [options] +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-print\-glsl\fR=\fI\,[index]\/\fR, \fB\-g\fR +.IP +Print GLSL for the nth shader (0 is the first OpenGL shader) +.HP +\fB\-\-print\-spirv\fR=\fI\,[index]\/\fR, \fB\-s\fR +.IP +Validate and print disasm for the nth shader (0 is the first Vulkan shader) +.HP +\fB\-\-print\-metal\fR=\fI\,[index]\/\fR, \fB\-m\fR +.IP +Print Metal Shading Language for the nth shader (0 is the first Metal shader) +.HP +\fB\-\-print\-vkglsl\fR=\fI\,[index]\/\fR, \fB\-v\fR +.IP +Print the nth Vulkan shader transpiled into GLSL +.HP +\fB\-\-print\-dic\-glsl\fR +.IP +Print the GLSL dictionary +.HP +\fB\-\-print\-dic\-metal\fR +.IP +Print the Metal dictionary +.HP +\fB\-\-print\-dic\-vk\fR +.IP +Print the Vulkan dictionary +.HP +\fB\-\-web\-server\fR=\fI\,[port]\/\fR, \fB\-w\fR +.IP +Serve a web page at the given port (e.g. 8080) +.HP +\fB\-\-dump\-binary\fR=\fI\,[index]\/\fR, \fB\-b\fR +.IP +Dump binary SPIRV for the nth Vulkan shader to 'out.spv' +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-analyze\-spirv\fR=\fI\,[index]\/\fR, \fB\-a\fR +.IP +Print annotated GLSL for the nth shader (0 is the first Vulkan shader) diff --git a/debian/manpages/mipgen.1 b/debian/manpages/mipgen.1 new file mode 100644 index 0000000..4c92043 --- /dev/null +++ b/debian/manpages/mipgen.1 @@ -0,0 +1,174 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH MIPGEN "1" "October 2021" "mipgen " "User Commands" +.SH NAME +mipgen \- filament material tools +.SH DESCRIPTION +mipgen generates mipmaps for an image down to the 1x1 level. +.PP +The argument is a printf\-style pattern. +For example, "mip%2d.png" generates mip01.png, mip02.png, etc. +Miplevel 0 is not generated since it is the original image. +.PP +If the output format is a container format like KTX, then + is simply a filename. +.SS "Usage:" +.IP +mipgen [options] +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +print copyright and license information +.HP +\fB\-\-linear\fR, \fB\-l\fR +.IP +assume that image pixels are already linearized +.HP +\fB\-\-page\fR, \fB\-p\fR +.IP +generate HTML page for review purposes (mipmap.html) +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +suppress console output from the mipgen tool +.HP +\fB\-\-grayscale\fR, \fB\-g\fR +.IP +create a single\-channel image and do not perform gamma correction +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|rgbm|psd|png|dds|ktx], \fB\-f\fR [exr|hdr|rgbm|psd|png|dds|ktx] +.IP +specify output file format, inferred from output pattern if omitted +.HP +\fB\-\-kernel\fR=\fI\,[box\/\fR|nearest|hermite|gaussian|normals|mitchell|lanczos|min], \fB\-k\fR [filter] +.IP +specify filter kernel type (defaults to lanczos) +the "normals" filter may automatically change the compression scheme +.HP +\fB\-\-add\-alpha\fR +.IP +if the source image has 3 channels, this adds a fourth channel filled with 1.0 +.HP +\fB\-\-strip\-alpha\fR +.IP +ignore the alpha component of the input image +.HP +\fB\-\-mip\-levels\fR=\fI\,N\/\fR, \fB\-m\fR N +.IP +specifies the number of mip levels to generate +if 0 (default), all levels are generated +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +KTX: +.IP +astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block size +s3tc_rgb_dxt1, s3tc_rgba_dxt5 +etc_FORMAT_METRIC_EFFORT +.TP +FORMAT is r11, signed_r11, rg11, signed_rg11, rgb8, srgb8, rgb8_alpha +srgb8_alpha, rgba8, or srgb8_alpha8 +.IP +METRIC is rgba, rgbx, rec709, numeric, or normalxyz +EFFORT is an integer between 0 and 100 +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +print copyright and license information +.HP +\fB\-\-linear\fR, \fB\-l\fR +.IP +assume that image pixels are already linearized +.HP +\fB\-\-page\fR, \fB\-p\fR +.IP +generate HTML page for review purposes (mipmap.html) +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +suppress console output from the mipgen tool +.HP +\fB\-\-grayscale\fR, \fB\-g\fR +.IP +create a single\-channel image and do not perform gamma correction +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|rgbm|psd|png|dds|ktx], \fB\-f\fR [exr|hdr|rgbm|psd|png|dds|ktx] +.IP +specify output file format, inferred from output pattern if omitted +.HP +\fB\-\-kernel\fR=\fI\,[box\/\fR|nearest|hermite|gaussian|normals|mitchell|lanczos|min], \fB\-k\fR [filter] +.IP +specify filter kernel type (defaults to lanczos) +the "normals" filter may automatically change the compression scheme +.HP +\fB\-\-add\-alpha\fR +.IP +if the source image has 3 channels, this adds a fourth channel filled with 1.0 +.HP +\fB\-\-strip\-alpha\fR +.IP +ignore the alpha component of the input image +.HP +\fB\-\-mip\-levels\fR=\fI\,N\/\fR, \fB\-m\fR N +.IP +specifies the number of mip levels to generate +if 0 (default), all levels are generated +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +KTX: +.IP +astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block size +s3tc_rgb_dxt1, s3tc_rgba_dxt5 +etc_FORMAT_METRIC_EFFORT +.TP +FORMAT is r11, signed_r11, rg11, signed_rg11, rgb8, srgb8, rgb8_alpha +srgb8_alpha, rgba8, or srgb8_alpha8 +.IP +METRIC is rgba, rgbx, rec709, numeric, or normalxyz +EFFORT is an integer between 0 and 100 +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.SH EXAMPLES +.IP +mipgen \-g \-\-kernel=hermite grassland.png mip_%03d.png +mipgen \-f ktx \-\-compression=astc_fast_ldr_4x4 grassland.png mips.ktx +mipgen \-f ktx \-\-compression=etc_rgb_rgba_40 grassland.png mips.ktx +.PP +mipgen generates mipmaps for an image down to the 1x1 level. +.PP +The argument is a printf\-style pattern. +For example, "mip%2d.png" generates mip01.png, mip02.png, etc. +Miplevel 0 is not generated since it is the original image. +.PP +If the output format is a container format like KTX, then + is simply a filename. +.SS "Usage:" +.IP +mipgen [options] +.IP +mipgen \-g \-\-kernel=hermite grassland.png mip_%03d.png +mipgen \-f ktx \-\-compression=astc_fast_ldr_4x4 grassland.png mips.ktx +mipgen \-f ktx \-\-compression=etc_rgb_rgba_40 grassland.png mips.ktx diff --git a/debian/manpages/normal-blending.1 b/debian/manpages/normal-blending.1 new file mode 100644 index 0000000..cdb60c4 --- /dev/null +++ b/debian/manpages/normal-blending.1 @@ -0,0 +1,69 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH NORMAL-BLENDING "1" "October 2021" "normal-blending is a tool for blending normal maps using Reoriented Normal Mapping" "User Commands" +.SH NAME +normal-blending \- filament material tools +.SH DESCRIPTION +normal\-blending is a tool for blending normal maps using Reoriented Normal Mapping +Usage: +.IP +normal\-blending [options] +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|png|dds], \fB\-f\fR [exr|hdr|psd|png|dds] +.IP +specify output file format, inferred from file name if omitted +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.SS "Usage:" +.IP +normal\-blending [options] +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|png|dds], \fB\-f\fR [exr|hdr|psd|png|dds] +.IP +specify output file format, inferred from file name if omitted +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 diff --git a/debian/manpages/resgen.1 b/debian/manpages/resgen.1 new file mode 100644 index 0000000..a71366a --- /dev/null +++ b/debian/manpages/resgen.1 @@ -0,0 +1,116 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH RESGEN "1" "October 2021" "resgen " "User Commands" +.SH NAME +resgen \- filament material tools +.SH DESCRIPTION +resgen aggregates a sequence of binary blobs, each of which becomes a "resource" whose id +is the basename of the input file. It produces the following set of files: +.IP +resources.h ......... declares sizes and offsets for each resource +resources.S ......... small assembly file with incbin directive and rodata section +resources.apple.S ... ditto but with different rodata name and underscore prefixes +resources.bin ....... the aggregated binary blob that the incbin refers to +.SS "Usage:" +.IP +resgen [options] ... +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +Print copyright and license information +.HP +\fB\-\-package\fR=\fI\,string\/\fR, \fB\-p\fR string +.IP +Name of the resource package (defaults to "resources") +This is used to generate filenames and symbol prefixes +.HP +\fB\-\-deploy\fR=\fI\,dir\/\fR, \fB\-x\fR dir (defaults to ".") +.IP +Generate everything needed for deployment into +.HP +\fB\-\-keep\fR, \fB\-k\fR +.IP +Keep file extensions when generating symbols +.HP +\fB\-\-text\fR, \fB\-t\fR +.IP +Append a null terminator to each data blob +.HP +\fB\-\-cfile\fR, \fB\-c\fR +.IP +Generate xxd\-style C file (useful for WebAssembly) +.HP +\fB\-\-json\fR, \fB\-j\fR +.IP +Embed a JSON string in the output that provides a summary +of all resource sizes and names. Useful for size analysis. +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +Suppress console output +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR, \fB\-L\fR +.IP +Print copyright and license information +.HP +\fB\-\-package\fR=\fI\,string\/\fR, \fB\-p\fR string +.IP +Name of the resource package (defaults to "resources") +This is used to generate filenames and symbol prefixes +.HP +\fB\-\-deploy\fR=\fI\,dir\/\fR, \fB\-x\fR dir (defaults to ".") +.IP +Generate everything needed for deployment into +.HP +\fB\-\-keep\fR, \fB\-k\fR +.IP +Keep file extensions when generating symbols +.HP +\fB\-\-text\fR, \fB\-t\fR +.IP +Append a null terminator to each data blob +.HP +\fB\-\-cfile\fR, \fB\-c\fR +.IP +Generate xxd\-style C file (useful for WebAssembly) +.HP +\fB\-\-json\fR, \fB\-j\fR +.IP +Embed a JSON string in the output that provides a summary +of all resource sizes and names. Useful for size analysis. +.HP +\fB\-\-quiet\fR, \fB\-q\fR +.IP +Suppress console output +.SH EXAMPLES +.IP +resgen \-cp textures jungle.png beach.png +> Generated files: textures.h, textures.S, textures.apple.S, textures.bin, textures.c +> Generated symbols: TEXTURES_JUNGLE_DATA, TEXTURES_JUNGLE_SIZE, +.IP +TEXTURES_BEACH_DATA, TEXTURES_BEACH_SIZE +.PP +resgen aggregates a sequence of binary blobs, each of which becomes a "resource" whose id +is the basename of the input file. It produces the following set of files: +.IP +resources.h ......... declares sizes and offsets for each resource +resources.S ......... small assembly file with incbin directive and rodata section +resources.apple.S ... ditto but with different rodata name and underscore prefixes +resources.bin ....... the aggregated binary blob that the incbin refers to +.SS "Usage:" +.IP +resgen [options] ... +.IP +resgen \-cp textures jungle.png beach.png +> Generated files: textures.h, textures.S, textures.apple.S, textures.bin, textures.c +> Generated symbols: TEXTURES_JUNGLE_DATA, TEXTURES_JUNGLE_SIZE, +.IP +TEXTURES_BEACH_DATA, TEXTURES_BEACH_SIZE diff --git a/debian/manpages/roughness-prefilter.1 b/debian/manpages/roughness-prefilter.1 new file mode 100644 index 0000000..d2e4034 --- /dev/null +++ b/debian/manpages/roughness-prefilter.1 @@ -0,0 +1,104 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH ROUGHNESS-PREFILTER "1" "October 2021" "roughness-prefilter generates pre-filtered roughness maps from normal maps" "User Commands" +.SH NAME +roughness-prefilter \- filament material tools +.SH DESCRIPTION +roughness\-prefilter generates pre\-filtered roughness maps from normal maps +to help mitigate specular aliasing. +Usage: +.IP +roughness\-prefilter [options] +.SS "Output note:" +.IP +One file will be generated per mip\-level. The size of the first level will be +the greater of the input normal map and input roughness map. +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-roughness\fR=\fI\,[0\/\fR..1], \fB\-r\fR [0..1] +.IP +desired constant roughness, ignored if \fB\-\-roughness\-map\fR is specified +.HP +\fB\-\-roughness\-map=\fR, \fB\-m\fR +.IP +input roughness map +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|png|dds|ktx], \fB\-f\fR [exr|hdr|psd|png|dds|ktx] +.IP +specify output file format, inferred from file name if omitted +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.HP +\fB\-\-linear\fR, \fB\-l\fR +.IP +force linear output when the PNG format is selected +.PP +to help mitigate specular aliasing. +Usage: +.IP +roughness\-prefilter [options] +.SS "Output note:" +.IP +One file will be generated per mip\-level. The size of the first level will be +the greater of the input normal map and input roughness map. +.SS "Supported input formats:" +.IP +PNG, 8 and 16 bits +Radiance (.hdr) +Photoshop (.psd), 16 and 32 bits +OpenEXR (.exr) +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.HP +\fB\-\-roughness\fR=\fI\,[0\/\fR..1], \fB\-r\fR [0..1] +.IP +desired constant roughness, ignored if \fB\-\-roughness\-map\fR is specified +.HP +\fB\-\-roughness\-map=\fR, \fB\-m\fR +.IP +input roughness map +.HP +\fB\-\-format\fR=\fI\,[exr\/\fR|hdr|psd|png|dds|ktx], \fB\-f\fR [exr|hdr|psd|png|dds|ktx] +.IP +specify output file format, inferred from file name if omitted +.HP +\fB\-\-compression\fR=\fI\,COMPRESSION\/\fR, \fB\-c\fR COMPRESSION +.IP +format specific compression: +.IP +PNG: Ignored +Radiance: Ignored +Photoshop: 16 (default), 32 +OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) +DDS: 8, 16 (default), 32 +.HP +\fB\-\-linear\fR, \fB\-l\fR +.IP +force linear output when the PNG format is selected diff --git a/debian/manpages/specular-color.1 b/debian/manpages/specular-color.1 new file mode 100644 index 0000000..3eccb58 --- /dev/null +++ b/debian/manpages/specular-color.1 @@ -0,0 +1,29 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH SPECULAR-COLOR "1" "October 2021" "specular-color computes the base color of a conductor from spectral data" "User Commands" +.SH NAME +specular-color \- filament material tools +.SH DESCRIPTION +specular\-color computes the base color of a conductor from spectral data +Usage: +.IP +specular\-color [options] +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information +.SS "Usage:" +.IP +specular\-color [options] +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Print this message +.HP +\fB\-\-license\fR +.IP +Print copyright and license information diff --git a/debian/not-installed b/debian/not-installed new file mode 100644 index 0000000..e7c97f2 --- /dev/null +++ b/debian/not-installed @@ -0,0 +1,6 @@ +usr/LICENSE +usr/include/trie +usr/lib/*/libbluegl.a +usr/lib/*/libbluevk.a +usr/lib/*/libcivetweb.a +usr/lib/*/libsmol-v.a diff --git a/debian/patches/0001-Build-against-system-libraries.patch b/debian/patches/0001-Build-against-system-libraries.patch new file mode 100644 index 0000000..87db874 --- /dev/null +++ b/debian/patches/0001-Build-against-system-libraries.patch @@ -0,0 +1,81 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:17:07 +0200 +Subject: Build against system libraries + +--- + CMakeLists.txt | 38 +++++++++++++++++++++----------------- + 1 file changed, 21 insertions(+), 17 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa51851..b82a941 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -573,12 +573,25 @@ function(get_resgen_vars ARCHIVE_DIR ARCHIVE_NAME) + endif() + endfunction() + ++# ================================================================================================== ++# External dependencies ++# ================================================================================================== ++find_package(GTest REQUIRED) ++find_package(tsl-robin-map REQUIRED) ++find_package(meshoptimizer REQUIRED) ++find_package(draco REQUIRED) ++if(IS_HOST_PLATFORM) ++ find_package(PNG REQUIRED) ++ find_package(SDL2 REQUIRED) ++ find_package(ZLIB REQUIRED) ++ find_package(tinyexr REQUIRED) ++endif() ++ + # ================================================================================================== + # Sub-projects + # ================================================================================================== + + # Common to all platforms +-add_subdirectory(${EXTERNAL}/libgtest/tnt) + add_subdirectory(${LIBRARIES}/camutils) + add_subdirectory(${LIBRARIES}/filabridge) + add_subdirectory(${LIBRARIES}/filaflat) +@@ -597,22 +610,17 @@ add_subdirectory(${FILAMENT}/filament) + add_subdirectory(${FILAMENT}/shaders) + add_subdirectory(${EXTERNAL}/civetweb/tnt) + add_subdirectory(${EXTERNAL}/hat-trie/tnt) +-add_subdirectory(${EXTERNAL}/imgui/tnt) +-add_subdirectory(${EXTERNAL}/robin-map/tnt) ++include(debian/cmake/imgui.cmake) + add_subdirectory(${EXTERNAL}/smol-v/tnt) +-add_subdirectory(${EXTERNAL}/benchmark/tnt) +-add_subdirectory(${EXTERNAL}/meshoptimizer) ++include(debian/cmake/benchmark.cmake) + add_subdirectory(${EXTERNAL}/cgltf/tnt) +-add_subdirectory(${EXTERNAL}/draco/tnt) +-add_subdirectory(${EXTERNAL}/jsmn/tnt) +-add_subdirectory(${EXTERNAL}/stb/tnt) ++include(debian/cmake/jsmn.cmake) ++include(debian/cmake/stb.cmake) + add_subdirectory(${EXTERNAL}/getopt) + + if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) +- # spirv-tools must come before filamat, as filamat relies on the presence of the +- # spirv-tools_SOURCE_DIR variable. +- add_subdirectory(${EXTERNAL}/spirv-tools) +- add_subdirectory(${EXTERNAL}/glslang/tnt) ++ include(debian/cmake/spirv-tools.cmake) ++ include(debian/cmake/glslang.cmake) + add_subdirectory(${EXTERNAL}/spirv-cross/tnt) + add_subdirectory(${LIBRARIES}/filamat) + +@@ -651,11 +659,7 @@ if (IS_HOST_PLATFORM) + + add_subdirectory(${EXTERNAL}/astcenc/tnt) + add_subdirectory(${EXTERNAL}/etc2comp) +- add_subdirectory(${EXTERNAL}/libassimp/tnt) +- add_subdirectory(${EXTERNAL}/libpng/tnt) +- add_subdirectory(${EXTERNAL}/libsdl2/tnt) +- add_subdirectory(${EXTERNAL}/libz/tnt) +- add_subdirectory(${EXTERNAL}/tinyexr/tnt) ++ include(debian/cmake/libassimp.cmake) + + add_subdirectory(${TOOLS}/cmgen) + add_subdirectory(${TOOLS}/cso-lut) diff --git a/debian/patches/0002-Disable-Java.patch b/debian/patches/0002-Disable-Java.patch new file mode 100644 index 0000000..dd00219 --- /dev/null +++ b/debian/patches/0002-Disable-Java.patch @@ -0,0 +1,23 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:48:53 +0200 +Subject: Disable Java + +--- + CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b82a941..b6cd7ab 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -651,10 +651,6 @@ if (IS_HOST_PLATFORM) + add_subdirectory(${LIBRARIES}/filamentapp) + add_subdirectory(${LIBRARIES}/imageio) + +- add_subdirectory(${FILAMENT}/java/filamat) +- add_subdirectory(${FILAMENT}/java/filament) +- add_subdirectory(${FILAMENT}/java/gltfio) +- + add_subdirectory(${FILAMENT}/samples) + + add_subdirectory(${EXTERNAL}/astcenc/tnt) diff --git a/debian/patches/0003-Fix-libstdc-compat.patch b/debian/patches/0003-Fix-libstdc-compat.patch new file mode 100644 index 0000000..4ff7a49 --- /dev/null +++ b/debian/patches/0003-Fix-libstdc-compat.patch @@ -0,0 +1,34 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 20:04:38 +0200 +Subject: Fix libstdc++ compat + +--- + filament/backend/include/backend/Handle.h | 2 ++ + libs/viewer/src/RemoteServer.cpp | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/filament/backend/include/backend/Handle.h b/filament/backend/include/backend/Handle.h +index 62572c7..73c97fe 100644 +--- a/filament/backend/include/backend/Handle.h ++++ b/filament/backend/include/backend/Handle.h +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + namespace filament { + namespace backend { + +diff --git a/libs/viewer/src/RemoteServer.cpp b/libs/viewer/src/RemoteServer.cpp +index d083dd1..441c730 100644 +--- a/libs/viewer/src/RemoteServer.cpp ++++ b/libs/viewer/src/RemoteServer.cpp +@@ -20,6 +20,7 @@ + + #include + ++#include + #include + + using namespace utils; diff --git a/debian/patches/0004-Fix-combine_static_libs-macro.patch b/debian/patches/0004-Fix-combine_static_libs-macro.patch new file mode 100644 index 0000000..b6bc7c2 --- /dev/null +++ b/debian/patches/0004-Fix-combine_static_libs-macro.patch @@ -0,0 +1,26 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:19:52 +0200 +Subject: Fix combine_static_libs macro + +--- + CMakeLists.txt | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b6cd7ab..6786b22 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -495,7 +495,12 @@ function(combine_static_libs TARGET OUTPUT DEPS) + # Loop through the dependent libraries and query their location on disk. + set(DEPS_FILES ) + foreach(DEPENDENCY ${DEPS}) +- list(APPEND DEPS_FILES "$") ++ if(TARGET ${DEPENDENCY}) ++ get_property(dep_type TARGET ${DEPENDENCY} PROPERTY TYPE) ++ if(dep_type STREQUAL "STATIC_LIBRARY") ++ list(APPEND DEPS_FILES "$") ++ endif() ++ endif() + endforeach() + + add_custom_command( diff --git a/debian/patches/0005-Fix-list_licenses-macro.patch b/debian/patches/0005-Fix-list_licenses-macro.patch new file mode 100644 index 0000000..0c104cf --- /dev/null +++ b/debian/patches/0005-Fix-list_licenses-macro.patch @@ -0,0 +1,31 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:20:10 +0200 +Subject: Fix list_licenses macro + +--- + CMakeLists.txt | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6786b22..8d674dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,11 +475,13 @@ function(list_licenses OUTPUT MODULES) + foreach(module ${_MODULES}) + set(license_path "../../third_party/${module}/LICENSE") + get_filename_component(fullname "${license_path}" ABSOLUTE) +- string(APPEND CONTENT "${STR_OPENER}License and copyrights for ${module}:\n${STR_CLOSER},\n") +- file(READ ${license_path} license_long) +- string(REPLACE "\n" "${STR_CLOSER},\n${STR_OPENER}" license ${license_long}) +- string(APPEND CONTENT ${STR_OPENER}${license}\n${STR_CLOSER},) +- string(APPEND CONTENT "\n\n") ++ if(EXISTS ${license_path}) ++ string(APPEND CONTENT "${STR_OPENER}License and copyrights for ${module}:\n${STR_CLOSER},\n") ++ file(READ ${license_path} license_long) ++ string(REPLACE "\n" "${STR_CLOSER},\n${STR_OPENER}" license ${license_long}) ++ string(APPEND CONTENT ${STR_OPENER}${license}\n${STR_CLOSER},) ++ string(APPEND CONTENT "\n\n") ++ endif() + endforeach() + configure_file(${FILAMENT}/build/licenses.inc.in ${OUTPUT}) + endfunction(list_licenses) diff --git a/debian/patches/0006-Adjust-linker-flags.patch b/debian/patches/0006-Adjust-linker-flags.patch new file mode 100644 index 0000000..981f96e --- /dev/null +++ b/debian/patches/0006-Adjust-linker-flags.patch @@ -0,0 +1,35 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:22:50 +0200 +Subject: Adjust linker flags + +--- + CMakeLists.txt | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d674dc..ce4192c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -331,12 +331,6 @@ endif() + # ================================================================================================== + # Linker flags + # ================================================================================================== +-# Strip unused sections +-if (NOT WEBGL) +- set(GC_SECTIONS "-Wl,--gc-sections") +-endif() +-set(B_SYMBOLIC_FUNCTIONS "-Wl,-Bsymbolic-functions") +- + if (APPLE) + set(GC_SECTIONS "-Wl,-dead_strip") + set(B_SYMBOLIC_FUNCTIONS "") +@@ -349,8 +343,7 @@ if (APPLE) + set(CMAKE_CXX_ARCHIVE_CREATE " qc -S ") + endif() + +-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GC_SECTIONS}") +-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GC_SECTIONS} ${B_SYMBOLIC_FUNCTIONS}") ++set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") + + if (WEBGL) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") diff --git a/debian/patches/0007-Link-against-libatomic.patch b/debian/patches/0007-Link-against-libatomic.patch new file mode 100644 index 0000000..4c36356 --- /dev/null +++ b/debian/patches/0007-Link-against-libatomic.patch @@ -0,0 +1,21 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:54:35 +0200 +Subject: Link against libatomic + +--- + libs/utils/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt +index b80de97..2a115f0 100644 +--- a/libs/utils/CMakeLists.txt ++++ b/libs/utils/CMakeLists.txt +@@ -101,7 +101,7 @@ if (LINUX) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(${TARGET} PRIVATE Threads::Threads) +- target_link_libraries(${TARGET} PRIVATE dl) ++ target_link_libraries(${TARGET} PRIVATE dl atomic) + endif() + + # ================================================================================================== diff --git a/debian/patches/0008-Migrate-to-astc-encoder-API-from-Debian-package.patch b/debian/patches/0008-Migrate-to-astc-encoder-API-from-Debian-package.patch new file mode 100644 index 0000000..2e88d6c --- /dev/null +++ b/debian/patches/0008-Migrate-to-astc-encoder-API-from-Debian-package.patch @@ -0,0 +1,349 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:17:50 +0200 +Subject: Migrate to astc-encoder API from Debian package + +--- + libs/imageio/src/BlockCompression.cpp | 291 +++++++++------------------------- + 1 file changed, 75 insertions(+), 216 deletions(-) + +diff --git a/libs/imageio/src/BlockCompression.cpp b/libs/imageio/src/BlockCompression.cpp +index f4e0e17..cb7d522 100644 +--- a/libs/imageio/src/BlockCompression.cpp ++++ b/libs/imageio/src/BlockCompression.cpp +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include + + #include +@@ -28,22 +29,17 @@ + #define STB_DXT_IMPLEMENTATION + #include + ++extern "C" ++{ ++ uint16_t float_to_sf16(float val); ++} ++ + namespace image { + + static LinearImage extendToFourChannels(LinearImage source); + + CompressedTexture astcCompress(const LinearImage& original, AstcConfig config) { + +- // If this is the first time, initialize the ARM encoder tables. +- +- static bool first = true; +- if (first) { +- test_inappropriate_extended_precision(); +- prepare_angular_tables(); +- build_quantization_mode_table(); +- first = false; +- } +- + // Check the validity of the given block size. + + using Format = CompressedFormat; +@@ -80,231 +76,94 @@ CompressedTexture astcCompress(const LinearImage& original, AstcConfig config) { + return {}; + } + +- // Create an input image for the ARM encoder in a format that it can consume. +- // It expects four-channel data, so we extend or curtail the channel count in a reasonable way. +- // The encoder can take half-floats or bytes, but we always give it half-floats. +- +- LinearImage source = extendToFourChannels(original); +- const uint32_t width = source.getWidth(); +- const uint32_t height = source.getHeight(); +- astc_codec_image* input_image = allocate_image(16, width, height, 1, 0); +- for (int y = 0; y < height; y++) { +- auto imagedata16 = input_image->imagedata16[0][y]; +- float const* src = source.getPixelRef(0, y); +- for (int x = 0; x < width; x++) { +- imagedata16[4 * x] = float_to_sf16(src[4 * x], SF_NEARESTEVEN); +- imagedata16[4 * x + 1] = float_to_sf16(src[4 * x + 1], SF_NEARESTEVEN); +- imagedata16[4 * x + 2] = float_to_sf16(src[4 * x + 2], SF_NEARESTEVEN); +- imagedata16[4 * x + 3] = float_to_sf16(src[4 * x + 3], SF_NEARESTEVEN); +- } +- } +- +- // Determine the bitrate based on the specified block size. +- +- int xdim_2d = config.blocksize.x, ydim_2d = config.blocksize.y; +- const float log10_texels_2d = std::log((float)(xdim_2d * ydim_2d)) / std::log(10.0f); +- const float bitrate = 128.0 / (xdim_2d * ydim_2d); +- +- // We do not fully support 3D textures yet, but we include some of the 3D config params anyway. +- +- int xdim_3d, ydim_3d, zdim_3d; +- find_closest_blockdim_3d(bitrate, &xdim_3d, &ydim_3d, &zdim_3d, 0); +- const float log10_texels_3d = std::log((float)(xdim_3d * ydim_3d * zdim_3d)) / log(10.0f); +- +- // Set up presets. +- +- int plimit_autoset; +- float oplimit_autoset; +- float dblimit_autoset_2d; +- float dblimit_autoset_3d; +- float bmc_autoset; +- float mincorrel_autoset; +- int maxiters_autoset; +- int pcdiv; +- ++ // Configure encoder ++ astcenc_config my_config; ++ float quality; + switch (config.quality) { + case AstcPreset::VERYFAST: +- plimit_autoset = 2; +- oplimit_autoset = 1.0; +- dblimit_autoset_2d = fmax(70 - 35 * log10_texels_2d, 53 - 19 * log10_texels_2d); +- dblimit_autoset_3d = fmax(70 - 35 * log10_texels_3d, 53 - 19 * log10_texels_3d); +- bmc_autoset = 25; +- mincorrel_autoset = 0.5; +- maxiters_autoset = 1; +- switch (ydim_2d) { +- case 4: pcdiv = 240; break; +- case 5: pcdiv = 56; break; +- case 6: pcdiv = 64; break; +- case 8: pcdiv = 47; break; +- case 10: pcdiv = 36; break; +- case 12: pcdiv = 30; break; +- default: pcdiv = 30; break; +- } ++ quality = ASTCENC_PRE_FASTEST; + break; + case AstcPreset::FAST: +- plimit_autoset = 4; +- oplimit_autoset = 1.0; +- dblimit_autoset_2d = fmax(85 - 35 * log10_texels_2d, 63 - 19 * log10_texels_2d); +- dblimit_autoset_3d = fmax(85 - 35 * log10_texels_3d, 63 - 19 * log10_texels_3d); +- bmc_autoset = 50; +- mincorrel_autoset = 0.5; +- maxiters_autoset = 1; +- switch (ydim_2d) { +- case 4: pcdiv = 60; break; +- case 5: pcdiv = 27; break; +- case 6: pcdiv = 30; break; +- case 8: pcdiv = 24; break; +- case 10: pcdiv = 16; break; +- case 12: pcdiv = 20; break; +- default: pcdiv = 20; break; +- } ++ quality = ASTCENC_PRE_FAST; + break; + case AstcPreset::MEDIUM: +- plimit_autoset = 25; +- oplimit_autoset = 1.2; +- dblimit_autoset_2d = fmax(95 - 35 * log10_texels_2d, 70 - 19 * log10_texels_2d); +- dblimit_autoset_3d = fmax(95 - 35 * log10_texels_3d, 70 - 19 * log10_texels_3d); +- bmc_autoset = 75; +- mincorrel_autoset = 0.75; +- maxiters_autoset = 2; +- switch (ydim_2d) { +- case 4: pcdiv = 25; break; +- case 5: pcdiv = 15; break; +- case 6: pcdiv = 15; break; +- case 8: pcdiv = 10; break; +- case 10: pcdiv = 8; break; +- case 12: pcdiv = 6; break; +- default: pcdiv = 6; break; +- } ++ quality = ASTCENC_PRE_MEDIUM; + break; + case AstcPreset::THOROUGH: +- plimit_autoset = 100; +- oplimit_autoset = 2.5; +- dblimit_autoset_2d = fmax(105 - 35 * log10_texels_2d, 77 - 19 * log10_texels_2d); +- dblimit_autoset_3d = fmax(105 - 35 * log10_texels_3d, 77 - 19 * log10_texels_3d); +- bmc_autoset = 95; +- mincorrel_autoset = 0.95f; +- maxiters_autoset = 4; +- switch (ydim_2d) { +- case 4: pcdiv = 12; break; +- case 5: pcdiv = 7; break; +- case 6: pcdiv = 7; break; +- case 8: pcdiv = 5; break; +- case 10: pcdiv = 4; break; +- case 12: pcdiv = 3; break; +- default: pcdiv = 3; break; +- } ++ quality = ASTCENC_PRE_THOROUGH; + break; + case AstcPreset::EXHAUSTIVE: +- plimit_autoset = 1 << 10; +- oplimit_autoset = 1000.0; +- dblimit_autoset_2d = 999.0f; +- dblimit_autoset_3d = 999.0f; +- bmc_autoset = 100; +- mincorrel_autoset = 0.99; +- maxiters_autoset = 4; +- switch (ydim_2d) { +- case 4: pcdiv = 3; break; +- case 5: pcdiv = 1; break; +- case 6: pcdiv = 1; break; +- case 8: pcdiv = 1; break; +- case 10: pcdiv = 1; break; +- case 12: pcdiv = 1; break; +- default: pcdiv = 1; break; +- } ++ quality = ASTCENC_PRE_EXHAUSTIVE; + break; + } ++ astcenc_config_init( ++ config.semantic == AstcSemantic::COLORS_HDR ? ++ ASTCENC_PRF_HDR : ++ (config.srgb ? ASTCENC_PRF_LDR_SRGB : ASTCENC_PRF_LDR), ++ config.blocksize.x, ++ config.blocksize.y, ++ 1, ++ quality, ++ config.semantic == AstcSemantic::NORMALS ? ASTCENC_FLG_MAP_NORMAL : 0, ++ &my_config ++ ); ++ ++ // Create encoding context ++ const int threadcount = 1; // std::thread::hardware_concurrency(); ++ astcenc_context *context; ++ astcenc_context_alloc(&my_config, threadcount, &context); + +- if (plimit_autoset < 1) { +- plimit_autoset = 1; +- } else if (plimit_autoset > PARTITION_COUNT) { +- plimit_autoset = PARTITION_COUNT; +- } ++ // Create an input image for the ARM encoder in a format that it can consume. ++ // It expects four-channel data, so we extend or curtail the channel count in a reasonable way. ++ // The encoder can take half-floats or bytes, but we always give it half-floats. + +- error_weighting_params ewp; +- ewp.rgb_power = 1.0f; +- ewp.alpha_power = 1.0f; +- ewp.rgb_base_weight = 1.0f; +- ewp.alpha_base_weight = 1.0f; +- ewp.rgb_mean_weight = 0.0f; +- ewp.rgb_stdev_weight = 0.0f; +- ewp.alpha_mean_weight = 0.0f; +- ewp.alpha_stdev_weight = 0.0f; +- ewp.rgb_mean_and_stdev_mixing = 0.0f; +- ewp.mean_stdev_radius = 0; +- ewp.enable_rgb_scale_with_alpha = 0; +- ewp.alpha_radius = 0; +- ewp.block_artifact_suppression = 0.0f; +- ewp.rgba_weights[0] = 1.0f; +- ewp.rgba_weights[1] = 1.0f; +- ewp.rgba_weights[2] = 1.0f; +- ewp.rgba_weights[3] = 1.0f; +- ewp.ra_normal_angular_scale = 0; +- ewp.max_refinement_iters = maxiters_autoset; +- ewp.block_mode_cutoff = bmc_autoset / 100.0f; +- ewp.texel_avg_error_limit = pow(0.1f, dblimit_autoset_2d * 0.1f) * 65535.0f * 65535.0f; +- ewp.partition_1_to_2_limit = oplimit_autoset; +- ewp.lowest_correlation_cutoff = mincorrel_autoset; +- ewp.partition_search_limit = plimit_autoset; +- +- // For now we do not support 3D textures but we keep the variable names consistent +- // with what's found in the ARM standalone tool. +- int xdim = xdim_2d, ydim = ydim_2d, zdim = 1; +- expand_block_artifact_suppression(xdim, ydim, zdim, &ewp); +- +- // Perform compression. +- +- swizzlepattern swz_encode = { 0, 1, 2, 3 }; +- swizzlepattern swz_decode = { 0, 1, 2, 3 }; +- astc_decode_mode decode_mode; +- switch (config.semantic) { +- case AstcSemantic::COLORS_LDR: +- decode_mode = config.srgb ? DECODE_LDR_SRGB : DECODE_LDR; +- break; +- case AstcSemantic::COLORS_HDR: +- decode_mode = DECODE_HDR; +- break; +- case AstcSemantic::NORMALS: +- decode_mode = config.srgb ? DECODE_LDR_SRGB : DECODE_LDR; +- ewp.rgba_weights[0] = 1.0f; +- ewp.rgba_weights[1] = 0.0f; +- ewp.rgba_weights[2] = 0.0f; +- ewp.rgba_weights[3] = 1.0f; +- ewp.ra_normal_angular_scale = 1; +- swz_encode.r = 0; +- swz_encode.g = 0; +- swz_encode.b = 0; +- swz_encode.a = 1; +- swz_decode.r = 0; +- swz_decode.g = 3; +- swz_decode.b = 6; +- swz_decode.a = 5; +- ewp.block_artifact_suppression = 1.8f; +- ewp.mean_stdev_radius = 3; +- ewp.rgb_mean_weight = 0; +- ewp.rgb_stdev_weight = 50; +- ewp.rgb_mean_and_stdev_mixing = 0.0; +- ewp.alpha_mean_weight = 0; +- ewp.alpha_stdev_weight = 50; +- break; ++ LinearImage source = extendToFourChannels(original); ++ const uint32_t width = source.getWidth(); ++ const uint32_t height = source.getHeight(); ++ astcenc_image input_image; ++ uint16_t *imagedata = new uint16_t[4 * width * height]; ++ input_image.dim_x = width; ++ input_image.dim_y = height; ++ input_image.dim_z = 1; ++ input_image.data_type = ASTCENC_TYPE_F16; ++ input_image.data = reinterpret_cast(&imagedata); ++ for (int y = 0; y < height; y++) { ++ auto imagedata16 = &imagedata[4 * width * y]; ++ float const* src = source.getPixelRef(0, y); ++ for (int x = 0; x < width; x++) { ++ imagedata16[4 * x] = float_to_sf16(src[4 * x]); ++ imagedata16[4 * x + 1] = float_to_sf16(src[4 * x + 1]); ++ imagedata16[4 * x + 2] = float_to_sf16(src[4 * x + 2]); ++ imagedata16[4 * x + 3] = float_to_sf16(src[4 * x + 3]); ++ } + } + +- const int threadcount = std::thread::hardware_concurrency(); +- +- const int xsize = input_image->xsize; +- const int ysize = input_image->ysize; +- const int zsize = input_image->zsize; +- const int xblocks = (xsize + xdim - 1) / xdim; +- const int yblocks = (ysize + ydim - 1) / ydim; +- const int zblocks = (zsize + zdim - 1) / zdim; ++ const int xblocks = (width + my_config.block_x - 1) / my_config.block_x; ++ const int yblocks = (height + my_config.block_y - 1) / my_config.block_y; ++ const astcenc_swizzle swz = { ASTCENC_SWZ_R, ASTCENC_SWZ_G, ASTCENC_SWZ_B, ASTCENC_SWZ_A }; + +- uint32_t size = xblocks * yblocks * zblocks * 16; ++ uint32_t size = xblocks * yblocks * 16; + uint8_t* buffer = new uint8_t[size]; + +- encode_astc_image(input_image, nullptr, xdim, ydim, zdim, &ewp, decode_mode, +- swz_encode, swz_decode, buffer, 0, threadcount); +- +- destroy_image(input_image); ++ // TODO Run this threadcount times in parallel ++ astcenc_error err = astcenc_compress_image( ++ context, ++ &input_image, ++ &swz, ++ buffer, ++ size, ++ 0 ++ ); ++ ++ delete[] imagedata; ++ astcenc_context_free(context); ++ ++ if (err != 0) ++ { ++ std::cerr << "astcCompress: error: " << astcenc_get_error_string(err) << "\n"; ++ free(buffer); ++ return {}; ++ } + + return { + .format = format, diff --git a/debian/patches/0009-Fix-library-export-for-Debian.patch b/debian/patches/0009-Fix-library-export-for-Debian.patch new file mode 100644 index 0000000..5a90ada --- /dev/null +++ b/debian/patches/0009-Fix-library-export-for-Debian.patch @@ -0,0 +1,1499 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Sat, 23 Oct 2021 19:38:20 +0200 +Subject: Fix library export for Debian + +--- + CMakeLists.txt | 24 ++++++++++-- + filament/CMakeLists.txt | 54 +++++++++++++++++++-------- + filament/backend/CMakeLists.txt | 47 ++++++++++++++++-------- + filament/benchmark/CMakeLists.txt | 3 +- + filament/test/CMakeLists.txt | 4 +- + libs/bluegl/CMakeLists.txt | 2 +- + libs/bluevk/CMakeLists.txt | 4 +- + libs/camutils/CMakeLists.txt | 24 ++++++++---- + libs/filabridge/CMakeLists.txt | 34 +++++++++++++---- + libs/filaflat/CMakeLists.txt | 35 +++++++++--------- + libs/filagui/CMakeLists.txt | 27 +++++++++++--- + libs/filamat/CMakeLists.txt | 61 +++++++++++++++++++++---------- + libs/filameshio/CMakeLists.txt | 30 +++++++++++---- + libs/geometry/CMakeLists.txt | 24 ++++++++---- + libs/gltfio/CMakeLists.txt | 54 ++++++++++++++++++++------- + libs/ibl/CMakeLists.txt | 45 ++++++++++++++++------- + libs/iblprefilter/CMakeLists.txt | 31 ++++++++++------ + libs/image/CMakeLists.txt | 34 +++++++++++------ + libs/imageio/CMakeLists.txt | 26 ++++++++++--- + libs/matdbg/CMakeLists.txt | 63 ++++++++++++++++---------------- + libs/math/CMakeLists.txt | 19 ++++++---- + libs/mathio/CMakeLists.txt | 23 ++++++++---- + libs/utils/CMakeLists.txt | 31 +++++++++------- + libs/viewer/CMakeLists.txt | 24 +++++++++--- + shaders/CMakeLists.txt | 10 ++++- + tools/cmgen/CMakeLists.txt | 4 +- + tools/cso-lut/CMakeLists.txt | 2 +- + tools/filamesh/CMakeLists.txt | 2 +- + tools/glslminifier/CMakeLists.txt | 2 +- + tools/matc/CMakeLists.txt | 4 +- + tools/matinfo/CMakeLists.txt | 4 +- + tools/mipgen/CMakeLists.txt | 2 +- + tools/normal-blending/CMakeLists.txt | 2 +- + tools/roughness-prefilter/CMakeLists.txt | 2 +- + 34 files changed, 508 insertions(+), 249 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ce4192c..a95c557 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -577,15 +577,20 @@ endfunction() + # External dependencies + # ================================================================================================== + find_package(GTest REQUIRED) ++find_package(astcenc REQUIRED) + find_package(tsl-robin-map REQUIRED) + find_package(meshoptimizer REQUIRED) + find_package(draco REQUIRED) ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++find_package(Threads REQUIRED) + if(IS_HOST_PLATFORM) + find_package(PNG REQUIRED) + find_package(SDL2 REQUIRED) + find_package(ZLIB REQUIRED) + find_package(tinyexr REQUIRED) + endif() ++include(debian/cmake/imgui.cmake) ++include(debian/cmake/stb.cmake) + + # ================================================================================================== + # Sub-projects +@@ -610,12 +615,10 @@ add_subdirectory(${FILAMENT}/filament) + add_subdirectory(${FILAMENT}/shaders) + add_subdirectory(${EXTERNAL}/civetweb/tnt) + add_subdirectory(${EXTERNAL}/hat-trie/tnt) +-include(debian/cmake/imgui.cmake) + add_subdirectory(${EXTERNAL}/smol-v/tnt) + include(debian/cmake/benchmark.cmake) + add_subdirectory(${EXTERNAL}/cgltf/tnt) + include(debian/cmake/jsmn.cmake) +-include(debian/cmake/stb.cmake) + add_subdirectory(${EXTERNAL}/getopt) + + if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM) +@@ -653,7 +656,6 @@ if (IS_HOST_PLATFORM) + + add_subdirectory(${FILAMENT}/samples) + +- add_subdirectory(${EXTERNAL}/astcenc/tnt) + add_subdirectory(${EXTERNAL}/etc2comp) + include(debian/cmake/libassimp.cmake) + +@@ -674,3 +676,19 @@ endif() + if (NOT CMAKE_CROSSCOMPILING) + export(TARGETS matc cmgen filamesh mipgen resgen glslminifier FILE ${IMPORT_EXECUTABLES}) + endif() ++ ++include(CMakePackageConfigHelpers) ++configure_package_config_file(debian/cmake/package-config.cmake.in filamentConfig.cmake ++ INSTALL_DESTINATION ${FILAMENT_CMAKEDIR} ++ NO_SET_AND_CHECK_MACRO ++ NO_CHECK_REQUIRED_COMPONENTS_MACRO ++) ++write_basic_package_version_file(filamentConfigVersion.cmake ++ VERSION ${FILAMENT_VERSION} ++ COMPATIBILITY SameMinorVersion ++) ++install(EXPORT filamentTargets NAMESPACE filament:: DESTINATION ${FILAMENT_CMAKEDIR}) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/filamentConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/filamentConfigVersion.cmake DESTINATION ${FILAMENT_CMAKEDIR}) ++install(FILES debian/cmake/imgui.cmake DESTINATION ${FILAMENT_CMAKEDIR}) ++install(FILES debian/cmake/stb.cmake DESTINATION ${FILAMENT_CMAKEDIR}) ++ +diff --git a/filament/CMakeLists.txt b/filament/CMakeLists.txt +index 09c77eb..514e430 100644 +--- a/filament/CMakeLists.txt ++++ b/filament/CMakeLists.txt +@@ -345,31 +345,52 @@ list(APPEND DATA_BINS ${output_path}) + # ================================================================================================== + # Includes & target definition + # ================================================================================================== +-# specify where our headers are +-include_directories(${PUBLIC_HDR_DIR}) +-include_directories(${GENERATION_ROOT}) +-include_directories(src) + + # we're building a library +-add_library(${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS} ${DATA_BINS}) ++add_library(${TARGET} SHARED ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS} ${DATA_BINS}) + + # specify where the public headers of this library are +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_include_directories(${TARGET} PRIVATE ++ ${CMAKE_CURRENT_SOURCE_DIR}/src ++ ${GENERATION_ROOT} ++) ++set_target_properties(${TARGET} PROPERTIES ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++add_library(filament::${TARGET} ALIAS ${TARGET}) ++ ++add_library(${TARGET}_headers INTERFACE) ++target_include_directories(${TARGET}_headers INTERFACE ++ $ ++ $ ++) ++set_target_properties(${TARGET}_headers PROPERTIES ++ EXPORT_NAME "${TARGET}::headers" ++) ++target_compile_features(${TARGET}_headers INTERFACE cxx_std_17) ++add_library(filament::${TARGET}::headers ALIAS ${TARGET}_headers) + + # ================================================================================================== + # Dependencies + # ================================================================================================== + +-target_link_libraries(${TARGET} PUBLIC backend) +-target_link_libraries(${TARGET} PUBLIC math) +-target_link_libraries(${TARGET} PUBLIC utils) +-target_link_libraries(${TARGET} PUBLIC geometry) # TODO: remove this dependency after deprecating VertexBuffer::populateTangentQuaternions +-target_link_libraries(${TARGET} PUBLIC filaflat) +-target_link_libraries(${TARGET} PUBLIC filabridge) +-target_link_libraries(${TARGET} PUBLIC ibl-lite) ++target_link_libraries(${TARGET} PUBLIC filament::backend) ++target_link_libraries(${TARGET} PUBLIC filament::math) ++target_link_libraries(${TARGET} PUBLIC filament::utils) ++target_link_libraries(${TARGET} PUBLIC filament::filabridge::headers) ++target_link_libraries(${TARGET} PRIVATE filament::geometry) ++target_link_libraries(${TARGET} PRIVATE filament::filaflat) ++target_link_libraries(${TARGET} PRIVATE filament::filabridge) ++target_link_libraries(${TARGET} PRIVATE filament::ibl_lite) + + if (FILAMENT_ENABLE_MATDBG) +- target_link_libraries(${TARGET} PUBLIC matdbg) ++ target_link_libraries(${TARGET} PRIVATE filament::matdbg) + add_definitions(-DFILAMENT_ENABLE_MATDBG=1) + else() + add_definitions(-DFILAMENT_ENABLE_MATDBG=0) +@@ -435,8 +456,8 @@ target_link_libraries(${TARGET} PRIVATE + # Installation + # ================================================================================================== + set(INSTALL_TYPE ARCHIVE) +-install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include) ++install(TARGETS ${TARGET} ${TARGET}_headers DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION ${FILAMENT_INCLUDEDIR}) + install(FILES "README.md" DESTINATION .) + install(FILES "../LICENSE" DESTINATION .) + +@@ -446,3 +467,4 @@ install(FILES "../LICENSE" DESTINATION .) + add_subdirectory(backend) + add_subdirectory(test) + add_subdirectory(benchmark) ++ +diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt +index 19fa52d..f61faee 100644 +--- a/filament/backend/CMakeLists.txt ++++ b/filament/backend/CMakeLists.txt +@@ -193,23 +193,38 @@ add_definitions(-DSYSTRACE_TAG=2 ) + # ================================================================================================== + # Includes & target definition + # ================================================================================================== +-# specify where our headers are +-include_directories(${PUBLIC_HDR_DIR}) +-include_directories(src) +-include_directories(${GENERATION_ROOT}) +- + # we're building a library +-add_library(${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) ++add_library(${TARGET} SHARED ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) + + # specify where the public headers of this library are +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_include_directories(${TARGET} PRIVATE ++ ${CMAKE_CURRENT_SOURCE_DIR}/src ++ ${GENERATION_ROOT} ++) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Expose a header-only target to minimize dependencies. + # ================================================================================================== + + add_library(${TARGET}_headers INTERFACE) +-target_include_directories(${TARGET}_headers INTERFACE ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET}_headers INTERFACE ++ $ ++ $ ++) ++set_target_properties(${TARGET}_headers PROPERTIES ++ EXPORT_NAME "${TARGET}::headers" ++) ++add_library(filament::${TARGET}::headers ALIAS ${TARGET}_headers) + + # ================================================================================================== + # Build SPIRV snippets used by the Vulkan backend. +@@ -249,6 +264,7 @@ set(DUMMY_SRC "${VKSHADERS_DIR}/dummy.c") + add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + + add_library(vkshaders STATIC ${DUMMY_SRC} ${RESGEN_SOURCE}) ++set_target_properties(vkshaders PROPERTIES OUTPUT_NAME "filament_vkshaders" VERSION ${FILAMENT_VERSION}) + + # ================================================================================================== + # Dependencies +@@ -259,15 +275,15 @@ if (ANDROID) + endif() + + if (FILAMENT_USE_SWIFTSHADER) +- target_link_libraries(${TARGET} PUBLIC ${SWIFTSHADER_VK}) ++ target_link_libraries(${TARGET} PRIVATE ${SWIFTSHADER_VK}) + endif() + + if (APPLE AND NOT IOS) + target_link_libraries(${TARGET} PRIVATE "-framework Cocoa") + endif() + +-target_link_libraries(${TARGET} PUBLIC math) +-target_link_libraries(${TARGET} PUBLIC utils) ++target_link_libraries(${TARGET} PUBLIC filament::math) ++target_link_libraries(${TARGET} PUBLIC filament::utils) + + # Android, iOS, and WebGL do not use bluegl. + if(NOT IOS AND NOT ANDROID AND NOT WEBGL) +@@ -275,7 +291,7 @@ if(NOT IOS AND NOT ANDROID AND NOT WEBGL) + endif() + + if (FILAMENT_SUPPORTS_VULKAN) +- target_link_libraries(${TARGET} PUBLIC bluevk vkmemalloc vkshaders) ++ target_link_libraries(${TARGET} PRIVATE bluevk vkmemalloc vkshaders smol-v) + endif() + + if (FILAMENT_SUPPORTS_METAL) +@@ -283,6 +299,7 @@ if (FILAMENT_SUPPORTS_METAL) + endif() + + if (LINUX) ++ target_link_libraries(${TARGET} PUBLIC Threads::Threads) + target_link_libraries(${TARGET} PRIVATE dl) + endif() + +@@ -343,9 +360,9 @@ target_link_libraries(${TARGET} PRIVATE + # Installation + # ================================================================================================== + set(INSTALL_TYPE ARCHIVE) +-install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(TARGETS vkshaders ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/backend DESTINATION include) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(TARGETS vkshaders backend_headers DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/backend DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Test +diff --git a/filament/benchmark/CMakeLists.txt b/filament/benchmark/CMakeLists.txt +index 3a1c57f..a4ac6ef 100644 +--- a/filament/benchmark/CMakeLists.txt ++++ b/filament/benchmark/CMakeLists.txt +@@ -10,4 +10,5 @@ set(BENCHMARK_SRCS + + add_executable(benchmark_filament ${BENCHMARK_SRCS}) + +-target_link_libraries(benchmark_filament PRIVATE benchmark_main utils math filament) ++target_include_directories(benchmark_filament PRIVATE ../src) ++target_link_libraries(benchmark_filament PRIVATE benchmark_main filament::utils filament::math filament::filament) +diff --git a/filament/test/CMakeLists.txt b/filament/test/CMakeLists.txt +index 6216701..5099da1 100644 +--- a/filament/test/CMakeLists.txt ++++ b/filament/test/CMakeLists.txt +@@ -57,6 +57,6 @@ endif() + add_executable(test_material_parser + filament_test_material_parser.cpp + ${RESGEN_SOURCE}) +-target_link_libraries(test_material_parser PRIVATE filament gtest) ++target_link_libraries(test_material_parser PRIVATE filament::filament filament::filaflat GTest::gtest) + target_compile_options(test_material_parser PRIVATE ${COMPILER_FLAGS}) +-target_include_directories(test_material_parser PRIVATE ${RESOURCE_DIR}) ++target_include_directories(test_material_parser PRIVATE ${RESOURCE_DIR} ../src) +diff --git a/libs/bluegl/CMakeLists.txt b/libs/bluegl/CMakeLists.txt +index 3f7ff83..b85c7f5 100644 +--- a/libs/bluegl/CMakeLists.txt ++++ b/libs/bluegl/CMakeLists.txt +@@ -61,4 +61,4 @@ endif() + + # and we're linking against the libraries below, importing their public headers + target_link_libraries(test_${TARGET} LINK_PUBLIC ${TARGET}) +-target_link_libraries(test_${TARGET} LINK_PUBLIC gtest) ++target_link_libraries(test_${TARGET} LINK_PUBLIC GTest::gtest) +diff --git a/libs/bluevk/CMakeLists.txt b/libs/bluevk/CMakeLists.txt +index eca0cd1..7b7d4e1 100644 +--- a/libs/bluevk/CMakeLists.txt ++++ b/libs/bluevk/CMakeLists.txt +@@ -25,14 +25,14 @@ include_directories(${PUBLIC_HDR_DIR}) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + +-target_link_libraries(${TARGET} utils math) ++target_link_libraries(${TARGET} filament::utils filament::math) + + target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) + + # test_bluevk is not supported on mobile or Windows + if (NOT ANDROID AND NOT IOS AND NOT WIN32) + add_executable(test_bluevk tests/test_bluevk_sdl.cpp) +- target_link_libraries(test_bluevk PRIVATE dl bluevk sdl2) ++ target_link_libraries(test_bluevk PRIVATE dl bluevk SDL2::SDL2) + endif() + + install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +diff --git a/libs/camutils/CMakeLists.txt b/libs/camutils/CMakeLists.txt +index de50254..43ef1f2 100644 +--- a/libs/camutils/CMakeLists.txt ++++ b/libs/camutils/CMakeLists.txt +@@ -23,13 +23,21 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) + +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) ++target_link_libraries(${TARGET} PUBLIC filament::math) + +-target_link_libraries(${TARGET} PUBLIC math) +- +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Compiler flags +@@ -44,13 +52,13 @@ endif() + # ================================================================================================== + # Installation + # ================================================================================================== +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/camutils DESTINATION include) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/camutils DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Tests + # ================================================================================================== + if (NOT ANDROID AND NOT WEBGL AND NOT IOS) + add_executable(test_${TARGET} tests/test_camutils.cpp) +- target_link_libraries(test_${TARGET} PRIVATE camutils gtest) ++ target_link_libraries(test_${TARGET} PRIVATE filament::camutils GTest::gtest) + endif() +diff --git a/libs/filabridge/CMakeLists.txt b/libs/filabridge/CMakeLists.txt +index 4b2691c..da2dddd 100644 +--- a/libs/filabridge/CMakeLists.txt ++++ b/libs/filabridge/CMakeLists.txt +@@ -20,17 +20,35 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) + +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_link_libraries(${TARGET} PRIVATE filament::utils) ++target_link_libraries(${TARGET} PUBLIC filament::math) ++target_link_libraries(${TARGET} PUBLIC filament::backend::headers) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + +-target_link_libraries(${TARGET} utils) +-target_link_libraries(${TARGET} math) +-target_link_libraries(${TARGET} backend_headers) ++add_library(${TARGET}_headers INTERFACE) ++target_include_directories(${TARGET}_headers INTERFACE ++ $ ++ $ ++) ++set_target_properties(${TARGET}_headers PROPERTIES ++ EXPORT_NAME "${TARGET}::headers" ++) ++add_library(filament::${TARGET}::headers ALIAS ${TARGET}_headers) + + # ================================================================================================== + # Installation + # ================================================================================================== +-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION include) +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filament DESTINATION ${FILAMENT_INCLUDEDIR}) ++install(TARGETS ${TARGET} ${TARGET}_headers DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) +diff --git a/libs/filaflat/CMakeLists.txt b/libs/filaflat/CMakeLists.txt +index ce4927f..6a4a9e5 100644 +--- a/libs/filaflat/CMakeLists.txt ++++ b/libs/filaflat/CMakeLists.txt +@@ -19,29 +19,28 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} ${HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +- +-target_link_libraries(${TARGET} filabridge utils) ++add_library(${TARGET} SHARED ${HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_link_libraries(${TARGET} PRIVATE filament::filabridge) ++target_link_libraries(${TARGET} PUBLIC filament::utils) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + if (FILAMENT_SUPPORTS_VULKAN) +- target_link_libraries(${TARGET} smol-v) +-endif() +- +-# ================================================================================================== +-# Compiler flags +-# ================================================================================================== +-if (NOT WIN32) +- target_compile_options(${TARGET} PRIVATE +- -fvisibility=hidden +- ) ++ target_link_libraries(${TARGET} PRIVATE smol-v) + endif() + + # ================================================================================================== + # Installation + # ================================================================================================== + # We do not need filaflat headers in the install directory +-# install(DIRECTORY ${PUBLIC_HDR_DIR}/filaflat DESTINATION include) +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filaflat DESTINATION ${FILAMENT_INCLUDEDIR}) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) +diff --git a/libs/filagui/CMakeLists.txt b/libs/filagui/CMakeLists.txt +index fe5373e..683d022 100644 +--- a/libs/filagui/CMakeLists.txt ++++ b/libs/filagui/CMakeLists.txt +@@ -75,14 +75,31 @@ list(APPEND RESGEN_SOURCE ${DUMMY_SRC}) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +-include_directories(${GENERATION_ROOT}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS} ${RESGEN_SOURCE}) + +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS} ${RESGEN_SOURCE}) ++target_link_libraries(${TARGET} PUBLIC filament::imgui filament::stb filament::filament) + +-target_link_libraries(${TARGET} PUBLIC imgui filament) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_include_directories(${TARGET} PRIVATE ++ ${GENERATION_ROOT} ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++ ++# ================================================================================================== ++# Installation ++# ================================================================================================== ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filagui DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Compiler flags +diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt +index 9645004..a130f0c 100644 +--- a/libs/filamat/CMakeLists.txt ++++ b/libs/filamat/CMakeLists.txt +@@ -84,18 +84,36 @@ include_directories(${PUBLIC_HDR_DIR}) + include_directories(${CMAKE_BINARY_DIR}) + + # Filamat +-add_library(${TARGET} STATIC ${HDRS} ${PRIVATE_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(${TARGET} shaders filabridge utils smol-v) ++add_library(${TARGET} SHARED ${HDRS} ${PRIVATE_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++target_link_libraries(${TARGET} PRIVATE filament::shaders filament::filabridge smol-v) ++target_link_libraries(${TARGET} PUBLIC filament::utils) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # Filamat Lite +-add_library(filamat_lite STATIC ${HDRS} ${LITE_PRIVATE_HDRS} ${LITE_SRCS}) +-target_include_directories(filamat_lite PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(filamat_lite shaders filabridge utils) +- +-# We are being naughty and accessing private headers here +-# For spirv-tools, we're just following glslang's example +-target_include_directories(${TARGET} PRIVATE ${spirv-tools_SOURCE_DIR}/include) ++add_library(filamat_lite SHARED ${HDRS} ${LITE_PRIVATE_HDRS} ${LITE_SRCS}) ++target_include_directories(filamat_lite PUBLIC ++ $ ++ $ ++) ++target_link_libraries(filamat_lite PRIVATE filament::shaders filament::filabridge) ++target_link_libraries(filamat_lite PUBLIC filament::utils) ++target_compile_features(filamat_lite PUBLIC cxx_std_17) ++set_target_properties(filamat_lite PROPERTIES ++ OUTPUT_NAME "filament_filamat_lite" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::filamat_lite ALIAS filamat_lite) + + # glslang libraries have circular dependencies. To make sure the proper object are part of the link + # we need to force archive re-scan on new symbol dependencies via start/end-group. +@@ -103,7 +121,7 @@ target_include_directories(${TARGET} PRIVATE ${spirv-tools_SOURCE_DIR}/include) + if (APPLE OR MSVC) + target_link_libraries(${TARGET} glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl) + else() +- target_link_libraries(${TARGET} ++ target_link_libraries(${TARGET} PRIVATE + -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) + endif() + +@@ -151,14 +169,14 @@ set(FILAMAT_DEPS + spirv-cross-msl + ) + +-set(FILAMAT_COMBINED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libfilamat_combined.a") +-combine_static_libs(filamat "${FILAMAT_COMBINED_OUTPUT}" "${FILAMAT_DEPS}") ++#set(FILAMAT_COMBINED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libfilamat_combined.a") ++#combine_static_libs(filamat "${FILAMAT_COMBINED_OUTPUT}" "${FILAMAT_DEPS}") + +-set(FILAMAT_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}filamat${CMAKE_STATIC_LIBRARY_SUFFIX}) +-install(FILES "${FILAMAT_COMBINED_OUTPUT}" DESTINATION lib/${DIST_DIR} RENAME ${FILAMAT_LIB_NAME}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/filamat DESTINATION include) ++#set(FILAMAT_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}filamat${CMAKE_STATIC_LIBRARY_SUFFIX}) ++#install(FILES "${FILAMAT_COMBINED_OUTPUT}" DESTINATION lib/${DIST_DIR} RENAME ${FILAMAT_LIB_NAME}) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filamat DESTINATION ${FILAMENT_INCLUDEDIR}) + +-install(TARGETS filamat_lite ARCHIVE DESTINATION lib/${DIST_DIR}) ++install(TARGETS ${TARGET} filamat_lite DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) + + # ================================================================================================== + # Tests +@@ -173,7 +191,9 @@ add_executable(${TARGET} ${SRCS}) + + target_include_directories(${TARGET} PRIVATE src) + +-target_link_libraries(${TARGET} filamat gtest) ++target_link_libraries(${TARGET} PRIVATE filament::backend filament::filabridge filament::filamat GTest::gtest) ++target_link_libraries(${TARGET} PRIVATE ++ -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) + + set(TARGET test_filamat_lite) + set(SRCS +@@ -183,4 +203,7 @@ add_executable(${TARGET} ${SRCS}) + + target_include_directories(${TARGET} PRIVATE src) + +-target_link_libraries(${TARGET} filamat_lite gtest) ++target_link_libraries(${TARGET} PRIVATE filament::backend filament::filabridge filament::filamat_lite GTest::gtest) ++target_link_libraries(${TARGET} PRIVATE ++ -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group) ++ +diff --git a/libs/filameshio/CMakeLists.txt b/libs/filameshio/CMakeLists.txt +index 7e7dc4e..2bbf51f 100644 +--- a/libs/filameshio/CMakeLists.txt ++++ b/libs/filameshio/CMakeLists.txt +@@ -18,25 +18,39 @@ set(SRCS src/MeshReader.cpp) + # ================================================================================================== + # Includes and target definition + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_link_libraries(${TARGET} +- PRIVATE meshoptimizer +- PUBLIC filament # Public only because the filamesh API needs Box.h ++ PRIVATE ++ filament::filament ++ meshoptimizer::meshoptimizer ++ PUBLIC ++ filament::math ++ filament::utils ++ filament::filament::headers # Public only because the filamesh API needs Box.h ++) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} + ) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Installation + # ================================================================================================== + set(INSTALL_TYPE ARCHIVE) +-install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(FILES ${DIST_HDRS} DESTINATION include/${TARGET}) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(FILES ${DIST_HDRS} DESTINATION ${FILAMENT_INCLUDEDIR}/${TARGET}) + + # ================================================================================================== + # Tests + # ================================================================================================== + if (NOT IOS AND NOT WEBGL AND NOT ANDROID) + add_executable(test_${TARGET} tests/test_filamesh.cpp ) +- target_link_libraries(test_${TARGET} PRIVATE filameshio gtest) ++ target_link_libraries(test_${TARGET} PRIVATE filament::filament filament::filameshio GTest::gtest) + endif() +diff --git a/libs/geometry/CMakeLists.txt b/libs/geometry/CMakeLists.txt +index 37db5a9..dd13c29 100644 +--- a/libs/geometry/CMakeLists.txt ++++ b/libs/geometry/CMakeLists.txt +@@ -20,13 +20,21 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) + +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) ++target_link_libraries(${TARGET} PUBLIC filament::math filament::utils) + +-target_link_libraries(${TARGET} PUBLIC math utils) +- +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Compiler flags +@@ -41,13 +49,13 @@ endif() + # ================================================================================================== + # Installation + # ================================================================================================== +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/geometry DESTINATION include) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/geometry DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Tests + # ================================================================================================== + if (NOT ANDROID AND NOT WEBGL AND NOT IOS) + add_executable(test_transcoder tests/test_transcoder.cpp) +- target_link_libraries(test_transcoder PRIVATE ${TARGET} gtest) ++ target_link_libraries(test_transcoder PRIVATE ${TARGET} GTest::gtest) + endif() +diff --git a/libs/gltfio/CMakeLists.txt b/libs/gltfio/CMakeLists.txt +index b759b0b..4e3c21f 100644 +--- a/libs/gltfio/CMakeLists.txt ++++ b/libs/gltfio/CMakeLists.txt +@@ -106,6 +106,12 @@ set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") + add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + + add_library(gltfio_resources ${DUMMY_SRC} ${RESGEN_SOURCE}) ++set_target_properties(gltfio_resources PROPERTIES ++ OUTPUT_NAME "filament_gltfio_resources" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::gltfio_resources ALIAS gltfio_resources) + + # ================================================================================================== + # Build "lite" resources library, which contains only a few materials +@@ -157,29 +163,49 @@ set(DUMMY_SRC "${LITE_DIR}/dummy.c") + add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + + add_library(gltfio_resources_lite ${DUMMY_SRC} ${RESGEN_SOURCE}) ++set_target_properties(gltfio_resources_lite PROPERTIES ++ OUTPUT_NAME "filament_gltfio_resources_lite" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::gltfio_resources_lite ALIAS gltfio_resources_lite) + + # ================================================================================================== + # Build the "core" library (no filamat) + # ================================================================================================== + + include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) +-link_libraries(math utils filament cgltf stb geometry gltfio_resources tsl trie) +- +-add_library(gltfio_core STATIC ${PUBLIC_HDRS} ${SRCS}) + +-target_include_directories(gltfio_core PUBLIC ${PUBLIC_HDR_DIR}) +- +-target_compile_definitions(gltfio_core PUBLIC -DGLTFIO_DRACO_SUPPORTED=1) +-target_link_libraries(gltfio_core PUBLIC dracodec) ++add_library(gltfio_core SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(gltfio_core PUBLIC ++ $ ++ $ ++) ++target_compile_features(gltfio_core PUBLIC cxx_std_17) ++target_compile_definitions(gltfio_core PRIVATE -DGLTFIO_DRACO_SUPPORTED=1) ++target_link_libraries(gltfio_core PRIVATE draco::draco_shared) ++target_link_libraries(gltfio_core PRIVATE filament::math filament::utils filament::filament cgltf filament::stb filament::geometry filament::gltfio_resources tsl::robin_map trie) ++set_target_properties(gltfio_core PROPERTIES ++ OUTPUT_NAME "filament_gltfio_core" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::gltfio_core ALIAS gltfio_core) + + if (NOT WEBGL AND NOT ANDROID AND NOT IOS) + + # ================================================================================================== + # Link the core library with additional dependencies to create the "full" library + # ================================================================================================== +- add_library(${TARGET} STATIC ${PUBLIC_HDRS} src/MaterialGenerator.cpp) +- target_link_libraries(${TARGET} PUBLIC filamat gltfio_core) +- target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++ add_library(${TARGET} SHARED ${PUBLIC_HDRS} src/MaterialGenerator.cpp) ++ target_link_libraries(${TARGET} PUBLIC filament::filamat filament::gltfio_core) ++ target_link_libraries(${TARGET} PRIVATE filament::math filament::utils filament::filament cgltf stb filament::geometry filament::gltfio_resources tsl::robin_map trie) ++ target_compile_features(${TARGET} PUBLIC cxx_std_17) ++ set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++ ) + + # ================================================================================================== + # Compiler flags +@@ -194,9 +220,11 @@ if (NOT WEBGL AND NOT ANDROID AND NOT IOS) + # ================================================================================================== + # Installation + # ================================================================================================== +- install(TARGETS ${TARGET} gltfio_core gltfio_resources gltfio_resources_lite ARCHIVE DESTINATION lib/${DIST_DIR}) +- install(DIRECTORY ${PUBLIC_HDR_DIR}/gltfio DESTINATION include) +- ++ install(TARGETS ${TARGET} gltfio_core gltfio_resources gltfio_resources_lite DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++ # The Image.h header is only needed within Filament and does not need to be distributed. ++ install(DIRECTORY ${PUBLIC_HDR_DIR}/gltfio ++ DESTINATION ${FILAMENT_INCLUDEDIR} ++ PATTERN "Image.h" EXCLUDE) + else() + + install(TARGETS gltfio_core gltfio_resources gltfio_resources_lite ARCHIVE DESTINATION lib/${DIST_DIR}) +diff --git a/libs/ibl/CMakeLists.txt b/libs/ibl/CMakeLists.txt +index 0719871..8c63f07 100644 +--- a/libs/ibl/CMakeLists.txt ++++ b/libs/ibl/CMakeLists.txt +@@ -31,32 +31,49 @@ set(SRCS + # ================================================================================================== + # Target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(${TARGET} math utils) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_link_libraries(${TARGET} PUBLIC filament::math filament::utils) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + +-add_library(${TARGET}-lite ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) +-target_compile_definitions(${TARGET}-lite PUBLIC -DFILAMENT_IBL_LITE=1) +-target_include_directories(${TARGET}-lite PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(${TARGET}-lite math utils) ++add_library(${TARGET}_lite ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) ++target_compile_definitions(${TARGET}_lite PUBLIC -DFILAMENT_IBL_LITE=1) ++target_compile_features(${TARGET}_lite PUBLIC cxx_std_17) ++target_include_directories(${TARGET}_lite PUBLIC ++ $ ++ $ ++) ++target_link_libraries(${TARGET}_lite PUBLIC filament::math filament::utils) ++set_target_properties(${TARGET}_lite PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}_lite" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET}_lite ALIAS ${TARGET}_lite) + + # ================================================================================================== + # Compile options and optimizations + # ================================================================================================== + if (MSVC) + target_compile_options(${TARGET} PRIVATE /fp:fast) +- target_compile_options(${TARGET}-lite PRIVATE /fp:fast) ++ target_compile_options(${TARGET}_lite PRIVATE /fp:fast) + else() + target_compile_options(${TARGET} PRIVATE -ffast-math) +- target_compile_options(${TARGET}-lite PRIVATE -ffast-math) ++ target_compile_options(${TARGET}_lite PRIVATE -ffast-math) + endif() + + + # ================================================================================================== + # Installation + # ================================================================================================== +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(TARGETS ${TARGET}-lite ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/ibl DESTINATION include) ++install(TARGETS ${TARGET} ${TARGET}_lite DESTINATION ${FILAMENT_LIBDIR}) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/ibl DESTINATION ${FILAMENT_INCLUDEDIR}) +diff --git a/libs/iblprefilter/CMakeLists.txt b/libs/iblprefilter/CMakeLists.txt +index 6bf2237..b78b8c9 100644 +--- a/libs/iblprefilter/CMakeLists.txt ++++ b/libs/iblprefilter/CMakeLists.txt +@@ -78,24 +78,33 @@ endif() + # ================================================================================================== + # Includes & target definition + # ================================================================================================== +-# specify where our headers are +-include_directories(${PUBLIC_HDR_DIR}) +-include_directories(${GENERATION_ROOT}) +-include_directories(src) + + # we're building a library +-add_library(${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) ++add_library(${TARGET} SHARED ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) + + # specify where the public headers of this library are +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_include_directories(${TARGET} PRIVATE ++ ${GENERATION_ROOT} ++ ${CMAKE_CURRENT_SOURCEDIR}/src ++) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_iblprefilter" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Dependencies + # ================================================================================================== + +-target_link_libraries(${TARGET} PUBLIC math) +-target_link_libraries(${TARGET} PUBLIC utils) +-target_link_libraries(${TARGET} PUBLIC filament) ++target_link_libraries(${TARGET} PRIVATE filament::math) ++target_link_libraries(${TARGET} PUBLIC filament::utils) ++target_link_libraries(${TARGET} PUBLIC filament::filament) + + # ================================================================================================== + # Compiler flags +@@ -133,5 +142,5 @@ target_link_libraries(${TARGET} PRIVATE + # Installation + # ================================================================================================== + set(INSTALL_TYPE ARCHIVE) +-install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/filament-iblprefilter DESTINATION include) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/filament-iblprefilter DESTINATION ${FILAMENT_INCLUDEDIR}) +diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt +index 3f5072e..95e828d 100644 +--- a/libs/image/CMakeLists.txt ++++ b/libs/image/CMakeLists.txt +@@ -26,13 +26,19 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +- +-target_link_libraries(${TARGET} PUBLIC math utils) +- +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_link_libraries(${TARGET} PUBLIC filament::math filament::utils) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Compiler flags +@@ -48,18 +54,24 @@ endif() + # Expose header-only utilities to lean-and-mean client projects. + # ================================================================================================== + add_library(image_headers INTERFACE) +-target_include_directories(image_headers INTERFACE ${PUBLIC_HDR_DIR}) ++target_include_directories(image_headers INTERFACE ++ $ ++ $ ++) ++set_target_properties(image_headers PROPERTIES EXPORT_NAME "image::headers") ++target_compile_features(image_headers INTERFACE cxx_std_17) ++add_library(filament::image::headers ALIAS image_headers) + + # ================================================================================================== + # Installation + # ================================================================================================== +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/image DESTINATION include) ++install(TARGETS ${TARGET} image_headers DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/image DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Tests + # ================================================================================================== + if (NOT ANDROID AND NOT WEBGL AND NOT IOS) + add_executable(test_${TARGET} tests/test_image.cpp) +- target_link_libraries(test_${TARGET} PRIVATE image imageio gtest) ++ target_link_libraries(test_${TARGET} PRIVATE filament::image filament::imageio GTest::gtest) + endif() +diff --git a/libs/imageio/CMakeLists.txt b/libs/imageio/CMakeLists.txt +index 0c3a6a3..a57b379 100644 +--- a/libs/imageio/CMakeLists.txt ++++ b/libs/imageio/CMakeLists.txt +@@ -24,16 +24,30 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +- +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) + +-target_link_libraries(${TARGET} PUBLIC image math png tinyexr utils z astcenc stb EtcLib) ++target_link_libraries(${TARGET} PUBLIC filament::image filament::math filament::utils) ++target_link_libraries(${TARGET} PRIVATE PNG::PNG tinyexr::tinyexr astcenc::astcenc filament::stb EtcLib Threads::Threads) + if (WIN32) + target_link_libraries(${TARGET} PRIVATE wsock32) + endif() ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) ++ ++# ================================================================================================== ++# Installation ++# ================================================================================================== ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/imageio DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Transitive macro definitions +diff --git a/libs/matdbg/CMakeLists.txt b/libs/matdbg/CMakeLists.txt +index c8c5976..86f23ed 100644 +--- a/libs/matdbg/CMakeLists.txt ++++ b/libs/matdbg/CMakeLists.txt +@@ -60,29 +60,45 @@ set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") + add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + + add_library(matdbg_resources ${DUMMY_SRC} ${RESGEN_SOURCE}) ++set_target_properties(matdbg_resources PROPERTIES ++ OUTPUT_NAME "filament_matdbg_resources" ++ VERSION ${FILAMENT_VERSION} ++) ++add_library(filament::matdbg_resources ALIAS matdbg_resources) + + # ================================================================================================== + # Include and target definitions + # ================================================================================================== + +-include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) +- +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +- ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) + target_link_libraries(${TARGET} PUBLIC +- utils +- filaflat +- filabridge +- backend_headers ++ filament::backend::headers ++ filament::filaflat ++ filament::filamat ++ filament::utils ++) ++target_link_libraries(${TARGET} PRIVATE ++ filament::filabridge + civetweb +- utils ++ glslang ++ filament::matdbg_resources + SPIRV +- SPIRV-Tools + spirv-cross-glsl +- matdbg_resources ++ SPIRV-Tools ++ smol-v + ) +- +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PRIVATE ${RESOURCE_DIR} ${filamat_SOURCE_DIR}/src) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Compiler flags +@@ -98,22 +114,5 @@ endif() + # ================================================================================================== + # Installation + # ================================================================================================== +- +-# matdbg has dependencies on non-installed libraries. Here we bundle them all together into a single +-# library that gets copied into the installation folder so users are only required to link against +-# matdbg. +-set(MATDBG_DEPS +- matdbg +- matdbg_resources +- civetweb +- SPIRV-Tools +- spirv-cross-core +- spirv-cross-glsl +- ) +- +-set(MATDBG_COMBINED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libmatdbg_combined.a") +-combine_static_libs(matdbg "${MATDBG_COMBINED_OUTPUT}" "${MATDBG_DEPS}") +- +-set(MATDBG_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}matdbg${CMAKE_STATIC_LIBRARY_SUFFIX}) +-install(FILES "${MATDBG_COMBINED_OUTPUT}" DESTINATION lib/${DIST_DIR} RENAME ${MATDBG_LIB_NAME}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/matdbg DESTINATION include) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/matdbg DESTINATION ${FILAMENT_INCLUDEDIR}) ++install(TARGETS ${TARGET} matdbg_resources DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) +diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt +index cdfe25c..c812501 100644 +--- a/libs/math/CMakeLists.txt ++++ b/libs/math/CMakeLists.txt +@@ -37,16 +37,19 @@ set(SRCS src/dummy.cpp) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++add_library(${TARGET} INTERFACE) ++target_include_directories(${TARGET} INTERFACE ++ $ ++ $ ++) ++target_compile_features(${TARGET} INTERFACE cxx_std_17) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Installation + # ================================================================================================== +-install(DIRECTORY ${PUBLIC_HDR_DIR}/math DESTINATION include) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/math DESTINATION ${FILAMENT_INCLUDEDIR}) ++install(TARGETS ${TARGET} EXPORT filamentTargets) + + # ================================================================================================== + # Tests +@@ -58,7 +61,7 @@ add_executable(test_${TARGET} + tests/test_vec.cpp + tests/test_quat.cpp + ) +-target_link_libraries(test_${TARGET} PRIVATE math gtest) ++target_link_libraries(test_${TARGET} PRIVATE filament::math GTest::gtest) + + # ================================================================================================== + # Benchmarks +@@ -71,4 +74,4 @@ add_executable(benchmark_${TARGET} ${BENCHMARK_SRCS}) + + target_compile_options(benchmark_${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) + +-target_link_libraries(benchmark_${TARGET} PRIVATE benchmark_main utils math) ++target_link_libraries(benchmark_${TARGET} PRIVATE benchmark_main filament::utils filament::math) +diff --git a/libs/mathio/CMakeLists.txt b/libs/mathio/CMakeLists.txt +index fc55a4b..2d0b04d 100644 +--- a/libs/mathio/CMakeLists.txt ++++ b/libs/mathio/CMakeLists.txt +@@ -22,15 +22,24 @@ set(SRCS src/ostream.cpp) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) + +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(${TARGET} PRIVATE math) ++target_link_libraries(${TARGET} PUBLIC filament::math) ++ ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Installation + # ================================================================================================== +-install(DIRECTORY ${PUBLIC_HDR_DIR}/mathio DESTINATION include) +- ++install(DIRECTORY ${PUBLIC_HDR_DIR}/mathio DESTINATION ${FILAMENT_INCLUDEDIR}) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) +diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt +index 2a115f0..38684c5 100644 +--- a/libs/utils/CMakeLists.txt ++++ b/libs/utils/CMakeLists.txt +@@ -81,11 +81,19 @@ endif() + # ================================================================================================== + # Includes and target definition + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) +- +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +-target_link_libraries(${TARGET} PUBLIC tsl) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_link_libraries(${TARGET} PUBLIC tsl::robin_map) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + if (ANDROID) + target_link_libraries(${TARGET} PUBLIC log) +@@ -98,8 +106,6 @@ if (WIN32) + endif() + + if (LINUX) +- set(THREADS_PREFER_PTHREAD_FLAG ON) +- find_package(Threads REQUIRED) + target_link_libraries(${TARGET} PRIVATE Threads::Threads) + target_link_libraries(${TARGET} PRIVATE dl atomic) + endif() +@@ -116,13 +122,12 @@ target_compile_options(${TARGET} PRIVATE + # ================================================================================================== + # Installation + # ================================================================================================== +-set(INSTALL_TYPE ARCHIVE) +-install(TARGETS ${TARGET} ${INSTALL_TYPE} DESTINATION lib/${DIST_DIR}) +-install(FILES ${DIST_HDRS} DESTINATION include/${TARGET}) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(FILES ${DIST_HDRS} DESTINATION ${FILAMENT_INCLUDEDIR}/${TARGET}) + if (LINUX OR ANDROID) +- install(FILES ${DIST_LINUX_HDRS} DESTINATION include/${TARGET_LINUX}) ++ install(FILES ${DIST_LINUX_HDRS} DESTINATION ${FILAMENT_INCLUDEDIR}/${TARGET_LINUX}) + else() +- install(FILES ${DIST_GENERIC_HDRS} DESTINATION include/${TARGET_GENERIC}) ++ install(FILES ${DIST_GENERIC_HDRS} DESTINATION ${FILAMENT_INCLUDEDIR}/${TARGET_GENERIC}) + endif() + + # ================================================================================================== +@@ -156,7 +161,7 @@ endif() + + add_executable(test_${TARGET} ${TEST_SRCS}) + +-target_link_libraries(test_${TARGET} PRIVATE gtest utils tsl math) ++target_link_libraries(test_${TARGET} PRIVATE GTest::gtest filament::utils filament::math) + + # ================================================================================================== + # Benchmarks +diff --git a/libs/viewer/CMakeLists.txt b/libs/viewer/CMakeLists.txt +index c9a3dcd..fe168d2 100644 +--- a/libs/viewer/CMakeLists.txt ++++ b/libs/viewer/CMakeLists.txt +@@ -27,9 +27,21 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_link_libraries(${TARGET} PUBLIC imgui filament gltfio_core filagui jsmn civetweb) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++add_library(${TARGET} SHARED ${PUBLIC_HDRS} ${SRCS}) ++ ++target_link_libraries(${TARGET} PUBLIC filament::filament) ++target_link_libraries(${TARGET} PRIVATE filament::imgui filament::gltfio_core filament::filagui jsmn civetweb) ++ ++target_include_directories(${TARGET} PUBLIC ++ $ ++ $ ++) ++target_compile_features(${TARGET} PUBLIC cxx_std_17) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) + + # ================================================================================================== + # Compiler flags +@@ -44,13 +56,13 @@ endif() + # ================================================================================================== + # Installation + # ================================================================================================== +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) +-install(DIRECTORY ${PUBLIC_HDR_DIR}/viewer DESTINATION include) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++install(DIRECTORY ${PUBLIC_HDR_DIR}/viewer DESTINATION ${FILAMENT_INCLUDEDIR}) + + # ================================================================================================== + # Tests + # ================================================================================================== + if (NOT ANDROID AND NOT WEBGL AND NOT IOS) + add_executable(test_settings tests/test_settings.cpp) +- target_link_libraries(test_settings PRIVATE ${TARGET} gtest) ++ target_link_libraries(test_settings PRIVATE ${TARGET} GTest::gtest) + endif() +diff --git a/shaders/CMakeLists.txt b/shaders/CMakeLists.txt +index fb4dda1..8b56e12 100644 +--- a/shaders/CMakeLists.txt ++++ b/shaders/CMakeLists.txt +@@ -105,10 +105,16 @@ endif() + # Include and target definitions + # ================================================================================================== + add_library(${TARGET} STATIC ${RESGEN_SOURCE}) +-target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) ++target_include_directories(${TARGET} PUBLIC $) ++add_library(filament::${TARGET} ALIAS ${TARGET}) + + # ================================================================================================== + # Installation + # ================================================================================================== + +-install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR}) ++install(TARGETS ${TARGET} DESTINATION ${FILAMENT_LIBDIR} EXPORT filamentTargets) ++set_target_properties(${TARGET} PROPERTIES ++ OUTPUT_NAME "filament_${TARGET}" ++ VERSION ${FILAMENT_VERSION} ++ SOVERSION ${FILAMENT_SOVERSION} ++) +diff --git a/tools/cmgen/CMakeLists.txt b/tools/cmgen/CMakeLists.txt +index c84f70f..27493d0 100644 +--- a/tools/cmgen/CMakeLists.txt ++++ b/tools/cmgen/CMakeLists.txt +@@ -22,7 +22,7 @@ set(SRCS + # ================================================================================================== + add_executable(${TARGET} ${HDRS} ${SRCS}) + +-target_link_libraries(${TARGET} PRIVATE math utils ibl z image imageio getopt) ++target_link_libraries(${TARGET} PRIVATE math utils ibl image imageio getopt Threads::Threads) + + # ================================================================================================== + # Compile options and optimizations +@@ -55,5 +55,5 @@ install(TARGETS ${TARGET} RUNTIME DESTINATION bin) + # ================================================================================================== + if (NOT ANDROID) + add_executable(test_${TARGET} tests/test_cmgen.cpp) +- target_link_libraries(test_${TARGET} PRIVATE image imageio gtest) ++ target_link_libraries(test_${TARGET} PRIVATE image imageio GTest::gtest) + endif() +diff --git a/tools/cso-lut/CMakeLists.txt b/tools/cso-lut/CMakeLists.txt +index ead06a8..9f83f67 100644 +--- a/tools/cso-lut/CMakeLists.txt ++++ b/tools/cso-lut/CMakeLists.txt +@@ -15,7 +15,7 @@ set(SRCS src/main.cpp) + # ================================================================================================== + add_executable(${TARGET} ${HDRS} ${SRCS}) + +-target_link_libraries(${TARGET} PRIVATE math utils z image imageio getopt) ++target_link_libraries(${TARGET} PRIVATE math utils ZLIB::ZLIB image imageio getopt) + + # ================================================================================================== + # Compile options and optimizations +diff --git a/tools/filamesh/CMakeLists.txt b/tools/filamesh/CMakeLists.txt +index 3cc8bda..f7eacd1 100644 +--- a/tools/filamesh/CMakeLists.txt ++++ b/tools/filamesh/CMakeLists.txt +@@ -19,7 +19,7 @@ add_executable(${TARGET} ${SRCS}) + target_link_libraries(${TARGET} PUBLIC math) + target_link_libraries(${TARGET} PUBLIC utils) + target_link_libraries(${TARGET} PUBLIC assimp) +-target_link_libraries(${TARGET} PRIVATE getopt filameshio meshoptimizer) ++target_link_libraries(${TARGET} PRIVATE getopt filameshio meshoptimizer::meshoptimizer) + + # ================================================================================================== + # Compile options and optimizations +diff --git a/tools/glslminifier/CMakeLists.txt b/tools/glslminifier/CMakeLists.txt +index 5a6837f..0549fbf 100644 +--- a/tools/glslminifier/CMakeLists.txt ++++ b/tools/glslminifier/CMakeLists.txt +@@ -36,5 +36,5 @@ if (NOT ANDROID) + tests/test_glslminifier.cpp + ) + target_include_directories(test_${TARGET} PRIVATE src) +- target_link_libraries(test_${TARGET} PRIVATE gtest) ++ target_link_libraries(test_${TARGET} PRIVATE GTest::gtest) + endif() +diff --git a/tools/matc/CMakeLists.txt b/tools/matc/CMakeLists.txt +index cb8c934..8eef505 100644 +--- a/tools/matc/CMakeLists.txt ++++ b/tools/matc/CMakeLists.txt +@@ -44,7 +44,7 @@ add_library(${TARGET} STATIC ${SRCS} ${HDRS}) + target_include_directories(${TARGET} PUBLIC src) + target_include_directories(${TARGET} PRIVATE ${filamat_SOURCE_DIR}/src) + +-target_link_libraries(${TARGET} getopt filamat filabridge utils) ++target_link_libraries(${TARGET} getopt filamat filabridge utils glslang smol-v) + + # ================================================================================================= + # Licenses +@@ -89,4 +89,4 @@ set(SRCS + + add_executable(${TARGET} ${SRCS}) + +-target_link_libraries(${TARGET} matlang gtest) ++target_link_libraries(${TARGET} matlang GTest::gtest) +diff --git a/tools/matinfo/CMakeLists.txt b/tools/matinfo/CMakeLists.txt +index 17d948f..37b56f5 100644 +--- a/tools/matinfo/CMakeLists.txt ++++ b/tools/matinfo/CMakeLists.txt +@@ -13,12 +13,12 @@ set(SRCS src/main.cpp) + # ================================================================================================== + add_executable(${TARGET} ${SRCS}) + +-target_link_libraries(${TARGET} matdbg filaflat backend_headers utils getopt SPIRV-Tools spirv-cross-glsl) ++target_link_libraries(${TARGET} matdbg filaflat filabridge backend_headers utils getopt SPIRV-Tools spirv-cross-glsl glslang) + + # glslang contains a copy of the SPIRV headers, so let's just use those. The leading ".." in the + # following variable refers to the project name that we define in glslang/tnt, and the trailing ".." + # in the path allows us to do #include +-target_include_directories(${TARGET} PRIVATE ${../glslang_SOURCE_DIR}/..) ++#target_include_directories(${TARGET} PRIVATE ${../glslang_SOURCE_DIR}/..) + + # ================================================================================================= + # Licenses +diff --git a/tools/mipgen/CMakeLists.txt b/tools/mipgen/CMakeLists.txt +index 2686b40..38fdc60 100644 +--- a/tools/mipgen/CMakeLists.txt ++++ b/tools/mipgen/CMakeLists.txt +@@ -12,7 +12,7 @@ set(SRCS src/main.cpp) + # Target definitions + # ================================================================================================== + add_executable(${TARGET} ${SRCS}) +-target_link_libraries(${TARGET} PRIVATE math utils z image imageio getopt) ++target_link_libraries(${TARGET} PRIVATE math utils ZLIB::ZLIB image imageio getopt) + + # ================================================================================================= + # Licenses +diff --git a/tools/normal-blending/CMakeLists.txt b/tools/normal-blending/CMakeLists.txt +index 40be37f..73634ce 100644 +--- a/tools/normal-blending/CMakeLists.txt ++++ b/tools/normal-blending/CMakeLists.txt +@@ -15,7 +15,7 @@ set(SRCS src/main.cpp) + # ================================================================================================== + add_executable(${TARGET} ${HDRS} ${SRCS}) + +-target_link_libraries(${TARGET} PRIVATE math utils z image imageio getopt) ++target_link_libraries(${TARGET} PRIVATE math utils ZLIB::ZLIB image imageio getopt) + + # ================================================================================================== + # Compile options and optimizations +diff --git a/tools/roughness-prefilter/CMakeLists.txt b/tools/roughness-prefilter/CMakeLists.txt +index 4112f81..fdbc3bb 100644 +--- a/tools/roughness-prefilter/CMakeLists.txt ++++ b/tools/roughness-prefilter/CMakeLists.txt +@@ -15,7 +15,7 @@ set(SRCS src/main.cpp) + # ================================================================================================== + add_executable(${TARGET} ${HDRS} ${SRCS}) + +-target_link_libraries(${TARGET} PRIVATE math utils z image imageio getopt) ++target_link_libraries(${TARGET} PRIVATE math utils ZLIB::ZLIB image imageio getopt) + + # ================================================================================================== + # Compile options and optimizations diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..7cbd69b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,9 @@ +0001-Build-against-system-libraries.patch +0002-Disable-Java.patch +0003-Fix-libstdc-compat.patch +0004-Fix-combine_static_libs-macro.patch +0005-Fix-list_licenses-macro.patch +0006-Adjust-linker-flags.patch +0007-Link-against-libatomic.patch +0008-Migrate-to-astc-encoder-API-from-Debian-package.patch +0009-Fix-library-export-for-Debian.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0ef0375 --- /dev/null +++ b/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/pkg-info.mk + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=+all future=+lfs + +FILAMENT_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed 's/[+~]dfsg[0-9]*$$//') +FILAMENT_SOVERSION := $(shell echo $(FILAMENT_VERSION) | cut -d. -f1,2) + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DFILAMENT_SKIP_SAMPLES=ON \ + -DFILAMENT_ENABLE_JAVA=OFF \ + -DUSE_STATIC_LIBCXX=OFF \ + -DFILAMENT_VERSION=$(FILAMENT_VERSION) \ + -DFILAMENT_SOVERSION=$(FILAMENT_SOVERSION) \ + -DFILAMENT_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \ + -DFILAMENT_INCLUDEDIR=include/filament-$(FILAMENT_SOVERSION) \ + -DFILAMENT_CMAKEDIR=lib/$(DEB_HOST_MULTIARCH)/cmake/filament-$(FILAMENT_SOVERSION) + +execute_after_dh_install-indep: + find debian/libfilament$(FILAMENT_SOVERSION)-assets/usr/share/filament -name *.html -delete diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/build b/debian/tests/build new file mode 100755 index 0000000..6582cb8 --- /dev/null +++ b/debian/tests/build @@ -0,0 +1,41 @@ +#!/bin/bash +set -e + +library="$1" +shift + +cd "$AUTOPKGTEST_TMP" +echo '8< -------------- CMakeLists.txt --------------------------------------' +tee CMakeLists.txt << EOF +cmake_minimum_required(VERSION 3.19) +project(test_build) +find_package(filament REQUIRED) +add_executable(test_program main.cpp) +target_link_libraries(test_program PRIVATE ${library}) +EOF +echo '8< --------------------------------------------------------------------' +rm -f main.cpp +for header in "$@" +do + echo '#include <'"$header"'>' >> main.cpp +done +cat >> main.cpp << EOF + +int main(int argc, char** argv) +{ + return 0; +} +EOF +echo +echo '8< -------------- main.cpp --------------------------------------------' +cat main.cpp +echo '8< --------------------------------------------------------------------' +echo +echo '$' mkdir build +mkdir build +echo +echo '$' cd build '&&' cmake .. +cd build && cmake .. +echo +echo '$' make VERBOSE=ON +make VERBOSE=ON diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..9fc3ada --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Test-Command: ./debian/tests/build filament::filament filament/Renderer.h +Depends: libfilament-dev, cmake, g++ +Features: test-name=filament::filament + +Test-Command: ./debian/tests/build filament::filagui filagui/ImGuiMath.h +Depends: libfilament-dev, cmake, g++ +Features: test-name=filament::filagui